/* Amira Abdelfadil — coordinated light/dark color system.
   This sheet loads LAST on both the home and inner-page stylesheets. */
:root { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;
  /* Homepage tokens */
  --ivory: #1b1919;
  --espresso: #141213;
  --latte: #302925;
  --beige: #342b29;
  --surface: #272323;
  --text: #f2eae2;
  --muted: #c9baae;
  --plum: #e0acb8;
  --burgundy: #e0acb8;
  --accent: #e0acb8;
  --accent-text: #201719;
  --line: #f2e3d52e;
  /* Inner-page tokens */
  --ink: #f2eae2;
  --clay: #c9a59b;
}
/* Header and shared interactive toggle */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 2.6rem;
  block-size: 2.6rem;
  min-inline-size: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--accent, var(--burgundy));
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease, color .22s ease;
}
.theme-toggle:hover { background: var(--latte); border-color: var(--accent, var(--burgundy)); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent, var(--burgundy)); outline-offset: 3px; }
.theme-toggle .theme-icon { display: block; inline-size: 1.1rem; block-size: 1.1rem; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: none; }

/* Home — only replace fixed colors the existing variables cannot reach. */
:root[data-theme="dark"] body { background: var(--ivory); color: var(--text); }
:root[data-theme="dark"] .topbar { background: #1b1919f2; border-color: var(--line); }
:root[data-theme="dark"] .topbar.scrolled { background: #242020f6; box-shadow: 0 7px 24px #0006; }
:root[data-theme="dark"] .hero-kicker { color: var(--accent); }
:root[data-theme="dark"] .film-link:hover, :root[data-theme="dark"] .film-link:focus-visible { border-color: #e0acb899; box-shadow: 0 12px 32px #0004; }
:root[data-theme="dark"] .frame-credit { background: #171416e6; color: #f8f4ec; }
:root[data-theme="dark"] .writing { --muted: #d2c3b7; }
:root[data-theme="dark"] .about { background: var(--latte); }
:root[data-theme="dark"] .footer {
  --text: #f3eae1;
  --muted: #c4b0a4;
  --accent: #e8b9c2;
  --line: #f2e3d538;
  color: var(--text);
  background: #100e0f;
}
:root[data-theme="dark"] .footer .display { color: var(--text); }
:root[data-theme="dark"] .film-no { color: #f8f4ec; background: #191516; }
:root[data-theme="dark"] .film-grid[data-layout="index"] .film-no { color: #f8f4ec; background: #191516; }
:root[data-theme="dark"] .project-dialog { background: var(--ivory); color: var(--text); box-shadow: 0 24px 90px #0009; }
:root[data-theme="dark"] .dialog-bar { background: var(--ivory); }

/* Days with Amira: dark hand-drawn title remains legible in both themes. */
:root[data-theme="dark"] .portrait-experience { --portrait-line: #f2e3d538; border-top-color: var(--portrait-line); }
:root[data-theme="dark"] .portrait-title-card { background: #292420; border-color: #4b4140; }
:root[data-theme="dark"] .portrait-tab:hover { background: #ffffff0b; }
:root[data-theme="dark"] .portrait-tab[aria-selected="true"] { background: #f8f4ec14; }
:root[data-theme="dark"] .portrait-scene { background: #24201f; }
:root[data-theme="dark"] .portrait-scene::before { border-color: #f8f4ec26; }
:root[data-theme="dark"] .portrait-modal { color: #f8f4ec; }

/* Inner pages — the header and photographic lightbox include fixed light hues. */
:root[data-theme="dark"] .project-hero img { background: #171414; }
:root[data-theme="dark"] .topbar.has-menu .nav-panel { background: var(--ivory); }
:root[data-theme="dark"] .lightbox { background: #171414; color: #f8f4ec; }
:root[data-theme="dark"] .lightbox-count, :root[data-theme="dark"] .lightbox-stage figcaption { color: #decfc5; }
:root[data-theme="dark"] .lightbox :focus-visible { outline-color: #e8b9c2; }

/* Thin white photography frames are an intentional editorial treatment.
   Preserve them in dark mode rather than inverting pictures. */
:root[data-theme="dark"] .photography-grid .image-link,
:root[data-theme="dark"] .photography-collection picture { box-shadow: 0 0 0 1px #f8f4ec35; }

@media (max-width: 950px) {
  .theme-toggle { inline-size: 2.45rem; block-size: 2.45rem; min-inline-size: 2.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}


/* Theme glyph reflects the current theme and remains optically centered. */
.theme-toggle { display: inline-grid; place-items: center; background: var(--surface, transparent); border-color: var(--accent, var(--burgundy)); }
.theme-toggle .theme-icon { inline-size: 1.25rem; block-size: 1.25rem; stroke-width: 1.8; margin: 0; }
.theme-toggle .theme-sun { display: block; }
.theme-toggle .theme-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: block; }


/* Unified site-wide dark mode: pure black negative space, no color overlay on photographs. */
:root[data-theme="dark"] {
  --ivory:#000000;--espresso:#000000;--latte:#000000;--beige:#080808;
  --surface:#000000;--text:#f8f4ec;--ink:#f8f4ec;--muted:#c9baae;
  --plum:#e0acb8;--burgundy:#e0acb8;--accent:#e0acb8;--accent-text:#000;
  --line:#f8f4ec2b;--paper:#000000;--clay:#e0acb8;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] .home-topbar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .topbar.scrolled,
:root[data-theme="dark"] .studio-header,
:root[data-theme="dark"] .ed-header,
:root[data-theme="dark"] .ed-panel,
:root[data-theme="dark"] .studio-embed-wrap,
:root[data-theme="dark"] .studio-card,
:root[data-theme="dark"] .studio-mobile,
:root[data-theme="dark"] .studio-footer,
:root[data-theme="dark"] .footer,
:root[data-theme="dark"] .about,
:root[data-theme="dark"] .latte,
:root[data-theme="dark"] .notes-home,
:root[data-theme="dark"] .home-content,
:root[data-theme="dark"] .home-footer,
:root[data-theme="dark"] .selected,
:root[data-theme="dark"] .more-links {
  background-color:#000000;
  color:var(--text, #f8f4ec);
}
:root[data-theme="dark"] .ed-hero,
:root[data-theme="dark"] .ed-hero h1 { color:#f8f4ec }
:root[data-theme="dark"] .ed-muted,
:root[data-theme="dark"] .ed-description {color:#c9baae}
:root[data-theme="dark"] .ed-field input,
:root[data-theme="dark"] .ed-field select,
:root[data-theme="dark"] .ed-field textarea {
  background:#080808;color:#f8f4ec;border-color:#f8f4ec44;
}
:root[data-theme="dark"] .ed-button.ghost { color:#f8f4ec }
:root[data-theme="dark"] .studio-embed-wrap {background:#000000}
:root[data-theme="dark"] .studio-header,
:root[data-theme="dark"] .ed-header {border-color:var(--line)}
:root[data-theme="dark"] .theme-toggle {background:#000;color:#e0acb8}
:root[data-theme="dark"] .home-topbar {background:#000}
:root[data-theme="dark"] .hero-copy h1 {color:#e0acb8}
:root:not([data-theme="dark"]) .hero-copy h1 {color:#f8f4ec}
@media (prefers-reduced-motion: no-preference) {
  body, .topbar, .home-topbar, .studio-header, .ed-header, .ed-panel,
  .studio-embed-wrap, .studio-card, .studio-footer, .footer, .about,
  .latte, .notes-home, .home-content, .home-footer,
  .studio-mobile, .theme-toggle, .ed-field input, .ed-field textarea,
  .ed-field select {
    transition:background-color .42s ease,color .42s ease,border-color .42s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  body, .topbar, .home-topbar, .studio-header, .ed-header, .ed-panel,
  .studio-embed-wrap, .studio-card, .studio-footer, .footer, .about,
  .latte, .notes-home, .home-content, .home-footer,
  .studio-mobile, .theme-toggle {transition:none!important}
}


/* Complete pure-black dark palette for the private Editorial Desk,
   educational classroom and content-management forms. Light mode untouched. */
:root[data-theme="dark"] {
  --edu-ivory:#000;
  --edu-ink:#f8f4ec;
  --edu-plum:#e0acb8;
  --edu-latte:#101010;
  --edu-line:#ffffff30;
  --edu-muted:#cbbfb8;
  --edu-paper:#0b0b0b;
  --cms-ivory:#000;
  --cms-ink:#f8f4ec;
  --cms-plum:#e0acb8;
  --cms-paper:#0b0b0b;
  --cms-line:#ffffff30;
  --cms-muted:#cbbfb8;
}
:root[data-theme="dark"] .edu-bar,
:root[data-theme="dark"] .edu-footer {background:#000;color:#f8f4ec}
:root[data-theme="dark"] :is(
  .edu-panel,.edu-card,.edu-lesson,.edu-file,.edu-tiny-list button,
  .cms-aside,.cms-editor>form,.cms-media-editor,.cms-home-editor,
  .ed-editor,.ed-list button,.ed-notice
) {
  background:#0b0b0b;
  color:#f8f4ec;
  border-color:#ffffff30;
}
:root[data-theme="dark"] :is(
  .edu-field input,.edu-field textarea,.edu-field select,
  .ed-field input,.ed-field textarea,.ed-field select,
  .cms-home-options select,.cms-home-photo-tools input[type=file],
  .cms-media-editor input[type=file]
) {
  background:#101010;
  color:#f8f4ec;
  border-color:#ffffff55;
}
:root[data-theme="dark"] :is(
  .edu-field input,.edu-field textarea,.ed-field input,.ed-field textarea
)::placeholder {color:#b2a8a2;opacity:1}
:root[data-theme="dark"] .edu-embed{background:#0b0b0b;border-color:#ffffff40}
:root[data-theme="dark"] .edu-button{background:#e0acb8;color:#000!important;border-color:#e0acb8}
:root[data-theme="dark"] .edu-button.alt{background:transparent;color:#e0acb8!important}
:root[data-theme="dark"] .edu-button.ghost{background:transparent;color:#f8f4ec!important;border-color:#ffffff55}
:root[data-theme="dark"] .ed-button:not(.alt):not(.ghost){background:#e0acb8;color:#000;border-color:#e0acb8}
:root[data-theme="dark"] .ed-button.alt{color:#e0acb8}
:root[data-theme="dark"] .ed-button.ghost{color:#f8f4ec}
:root[data-theme="dark"] .edu-status.is-error,
:root[data-theme="dark"] .cms-home-message.is-error {color:#ff9ea6}
