/* The photography pages (/photography/...), light theme. photography-dark.css
   overrides it for the dark theme (linked with data-theme-dark). Figures are
   drawn as SVG with classes only, so both themes color them here. */

.ph-page {
  --ph-gold: #c26d12;
  --ph-gold-soft: #fbecd6;
  --ph-gold-line: #ecc58f;
  --ph-blue: #2f4f9c;
  --ph-blue-soft: #e4eaf8;
  --ph-blue-line: #b5c3ea;
  --ph-good: #2f7d4f;
}

.ph-intro { margin-bottom: 18px; }
.ph-lede { margin-top: 10px; max-width: 64ch; color: var(--text); }
.ph-faint { color: var(--muted); font-size: 0.9rem; }
.ph-kicker { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ph-gold); }

/* ---- Tabs: the header's Photography menu, again on the page ---- */
.ph-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ph-tabs a {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}
.ph-tabs a:hover { color: var(--text); border-color: var(--muted); }
.ph-tabs a[aria-current="page"] { background: var(--ph-gold-soft); border-color: var(--ph-gold-line); color: var(--text); font-weight: 600; }
.ph-tabs a:focus-visible { outline: 2px solid var(--ph-gold); outline-offset: 1px; }

/* ---- Cards ---- */
.ph-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 0 0 18px;
  min-width: 0;
}
.ph-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.ph-card-head h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ph-gold); }
.ph-card-head .ph-faint { margin-left: auto; }
.ph-two { display: grid; gap: 0 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .ph-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ph-scroll { overflow-x: auto; }
.ph-band { margin: 26px 0 0; }

/* ---- Info tips: details/summary, so they work without JavaScript ---- */
.ph-info { position: relative; display: inline-block; vertical-align: middle; }
.ph-info summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font: italic 600 11px/1 Georgia, serif;
  cursor: pointer;
  user-select: none;
}
.ph-info summary::-webkit-details-marker { display: none; }
.ph-info[open] summary, .ph-info summary:hover { color: var(--text); border-color: var(--muted); }
.ph-info-body {
  position: absolute;
  z-index: 20;
  top: 24px;
  left: -12px;
  width: min(360px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.16);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 400;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .ph-card, .ph-intro { position: relative; }
  .ph-info { position: static; }
  .ph-info-body { left: 8px; right: 8px; width: auto; }
}

/* ---- Golden hour ---- */
.ph-hero {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--ph-gold-line);
  background: linear-gradient(135deg, var(--ph-gold-soft), var(--surface));
}
.ph-hero-blue { border-color: var(--ph-blue-line); background: linear-gradient(135deg, var(--ph-blue-soft), var(--surface)); }
.ph-hero-blue .ph-kicker { color: var(--ph-blue); }
.ph-hero-time { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 650; letter-spacing: -0.01em; margin-top: 4px; }
.ph-hero-sub { color: var(--muted); margin-top: 2px; }
.ph-outlook { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.ph-outlook b { font-weight: 650; }

.ph-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 0.82rem; color: var(--muted); margin-left: auto; }
.ph-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.ph-k-golden { background: #f0b04a; }
.ph-k-blue { background: #3c62b8; }
.ph-k-day { background: #d9e9f8; border: 1px solid #c3d6ea; }
.ph-k-night { background: #1c2550; }
.ph-k-cloud { background: #9aa3b2; }

.ph-ribbon-wrap { overflow-x: auto; }
.ph-ribbon { display: block; width: 100%; min-width: 620px; height: auto; }
.ph-b-day { fill: #d9e9f8; }
.ph-b-golden { fill: #f0b04a; }
.ph-b-blue { fill: #3c62b8; }
.ph-b-nautical { fill: #2a3a72; }
.ph-b-astro { fill: #1c2550; }
.ph-b-night { fill: #0f1534; }
.ph-r-label { font-size: 13px; font-weight: 650; }
.ph-r-golden { fill: #4a2a00; }
.ph-r-blue { fill: #eef2ff; }
.ph-r-tick { stroke: var(--muted); stroke-width: 1; }
.ph-r-hour { font-size: 13px; fill: var(--muted); }
.ph-r-sun { stroke: #e8891c; stroke-width: 2; stroke-dasharray: 3 3; }
.ph-r-now { stroke: #d6336c; stroke-width: 2; }
.ph-r-clouds rect { stroke: none; }
.ph-cl0 { fill: #dfe6ee; }
.ph-cl1 { fill: #c4ccd8; }
.ph-cl2 { fill: #a8b1c0; }
.ph-cl3 { fill: #8b95a6; }
.ph-cl4 { fill: #6c7688; }

.ph-rows { margin: 0; display: grid; gap: 8px; }
.ph-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 4px 10px; padding: 8px 10px; border-radius: 10px; }
.ph-row dt { font-weight: 600; }
.ph-row dd { margin: 0; }
.ph-row-golden { background: var(--ph-gold-soft); }
.ph-row-blue { background: var(--ph-blue-soft); }
@media (max-width: 420px) { .ph-row { grid-template-columns: minmax(0, 1fr); } }
.ph-facts { margin: 12px 0 0; display: grid; gap: 6px; font-size: 0.94rem; }
.ph-facts > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 10px; }
.ph-facts dt { color: var(--muted); }
.ph-facts dd { margin: 0; }
@media (max-width: 420px) { .ph-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.ph-arrow { width: 18px; height: 18px; vertical-align: -4px; }
.ph-arrow circle { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ph-arrow path { fill: var(--ph-gold); }

.ph-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ph-table th, .ph-table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ph-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ph-table td, .ph-table tbody th { white-space: nowrap; }
.ph-table tbody tr:hover { background: color-mix(in srgb, var(--ph-gold-soft) 45%, transparent); }
.ph-table a { color: var(--accent-moon); }

.ph-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent-moon-soft);
  color: var(--text);
  white-space: nowrap;
}
.ph-o-clear { background: #fff1d6; color: #7a4600; }
.ph-o-few { background: #fde3bf; color: #7a4100; }
.ph-o-partly { background: #ffd8b2; color: #8a3a00; }
.ph-o-mostly { background: #e6e2dc; color: #4b4740; }
.ph-o-overcast { background: #dde1e7; color: #3f4652; }
.ph-o-rain, .ph-o-storm, .ph-o-snow { background: #dde6f2; color: #2c4466; }
.ph-o-fog, .ph-o-haze { background: #ebe7df; color: #5a5245; }

.ph-tips ul { margin: 0 0 10px; padding-left: 1.2em; display: grid; gap: 6px; }
.ph-tips a { color: var(--accent-moon); }

/* ---- Forms (alignment planner, city-henge) ---- */
.ph-form { display: grid; gap: 12px; }
.ph-form .ph-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.ph-form label { display: grid; gap: 4px; font-size: 0.86rem; color: var(--muted); }
.ph-form input, .ph-form select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  min-width: 0;
}
.ph-form input[type="number"] { width: 8.5rem; }
.ph-form input:focus-visible, .ph-form select:focus-visible { outline: 2px solid var(--ph-gold); outline-offset: 1px; }
.ph-button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 8px 16px;
  background: var(--ph-gold);
  color: #fff;
  cursor: pointer;
}
.ph-button:hover { filter: brightness(1.06); }
.ph-button.ph-quiet { background: var(--accent-moon-soft); color: var(--text); }
.ph-segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ph-segmented label { display: block; padding: 6px 12px; cursor: pointer; color: var(--text); }
.ph-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ph-segmented label:has(input:checked) { background: var(--ph-gold-soft); font-weight: 600; }
.ph-segmented label:has(input:focus-visible) { outline: 2px solid var(--ph-gold); outline-offset: -2px; }

/* ---- Maps (alignment planner, city-henge) ---- */
.ph-map {
  position: relative;
  height: min(62vh, 520px);
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--masthead);
}
.ph-map[hidden] { display: none; }
.ph-map .maplibregl-map { position: absolute; inset: 0; }
.ph-map-note { margin-top: 8px; }
.ph-pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.45); }
.ph-pin-you { background: #2f6fde; }
.ph-pin-target { background: #d6336c; }

/* ---- Alignment planner ---- */
.ph-geometry { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.ph-geometry > div { padding: 10px 12px; border-radius: 12px; background: var(--accent-moon-soft); }
.ph-geometry dt { font-size: 0.8rem; color: var(--muted); }
.ph-geometry dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 650; }
.ph-body { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ph-body i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.ph-body-sun i { background: #f0a020; }
.ph-body-moon i { background: #b8c2d6; box-shadow: inset -3px 0 0 #6d7891; }
.ph-hit-good { color: var(--ph-good); font-weight: 600; }

/* ---- Moon observing ---- */
.ph-moon-top { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 820px) { .ph-moon-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.ph-moonfig { position: relative; max-width: 460px; margin: 0 auto; border-radius: 16px; }
.ph-moonfig svg, .ph-moonfig canvas { display: block; width: 100%; height: auto; }
/* The textured Moon (photo island) under the drawing's marks: the canvas first, the SVG over it. */
.ph-moonfig svg { position: relative; }
.ph-moonfig canvas { position: absolute; inset: 0; height: 100%; }
.ph-moonfig:not(.is-textured) canvas { display: none; }
.ph-moonfig.is-textured { background: radial-gradient(circle at 50% 50%, #161c3c 0%, #0b1130 55%, #070a1d 100%); }
.ph-moonfig.is-textured .ph-m-schematic { display: none; }
.ph-moonfig.is-textured .ph-m-limb { stroke: rgb(255 255 255 / 0.14); stroke-width: 1; }
.ph-moonfig.is-textured .ph-m-label { fill: #f6f2e8; stroke: rgb(7 10 29 / 0.85); stroke-width: 3.5px; }
.ph-moonfig.is-textured .ph-m-north { fill: #aab3cc; }
.ph-m-dark { fill: #2a2f3d; }
.ph-m-lit { fill: #f1ece0; }
.ph-m-limb { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ph-m-dot { fill: #d6336c; stroke: #fff; stroke-width: 1.2; }
.ph-m-dot-dim { fill: #9aa3b2; stroke: none; }
.ph-m-label { font-size: 12px; font-weight: 650; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.ph-m-term { fill: none; stroke: #e8891c; stroke-width: 1.2; stroke-dasharray: 4 3; }
.ph-m-north { font-size: 12px; font-weight: 650; fill: var(--muted); }
.ph-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.ph-kv dt { color: var(--muted); }
.ph-kv dd { margin: 0; }
.ph-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ph-feature { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.ph-feature h3 { font-size: 1rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ph-feature h3 .ph-n { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.ph-feature p { margin-top: 4px; font-size: 0.92rem; }
.ph-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ph-filters button {
  font: inherit;
  font-size: 0.86rem;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.ph-filters button[aria-pressed="true"] { background: var(--ph-gold-soft); border-color: var(--ph-gold-line); color: var(--text); font-weight: 600; }
.ph-filters .ph-count { align-self: center; margin-left: 4px; }
.ph-empty { margin: 10px 0 0; color: var(--muted); }
/* Sortable headers (photo island): the header's text becomes a button. */
.ph-sort {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ph-sort:hover { color: var(--text); }
.ph-sort:focus-visible { outline: 2px solid var(--ph-gold); outline-offset: 2px; border-radius: 3px; }
.ph-sort i { display: inline-block; width: 0.7em; font-style: normal; opacity: 0.35; }
.ph-sort i::before { content: "\2195"; }
th[aria-sort] .ph-sort { color: var(--text); }
th[aria-sort] .ph-sort i { opacity: 1; }
th[aria-sort="ascending"] .ph-sort i::before { content: "\2191"; }
th[aria-sort="descending"] .ph-sort i::before { content: "\2193"; }
.ph-l-terminator { background: #fde7c6; color: #7a4100; }
.ph-l-lit { background: #f4eedf; color: #5a4b2a; }
.ph-l-highSun { background: #fff6cf; color: #6a5600; }
.ph-l-dark { background: #e1e4ec; color: #3c4456; }
.ph-l-hidden { background: #ececec; color: #666; }
.ph-best { color: var(--ph-good); font-weight: 650; }
.ph-table tr[hidden] { display: none; }
.ph-kit { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* ---- City-henge ---- */
.ph-grids { display: grid; gap: 14px; }
.ph-grid { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ph-grid h3 { font-size: 1.02rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.ph-grid ul { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 6px; }
.ph-rose { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; }
.ph-rose-bar { fill: #9aa3b2; }
.ph-rose-peak { fill: var(--ph-gold); }
.ph-rose-sunset { fill: none; stroke: #e8891c; stroke-width: 6; opacity: 0.35; }
.ph-rose-sunrise { fill: none; stroke: #3c62b8; stroke-width: 6; opacity: 0.3; }
.ph-rose-ring { fill: none; stroke: var(--line); }
.ph-rose-label { font-size: 11px; fill: var(--muted); }
.ph-henge-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 10px; }
.ph-henge-controls input[type="range"] { width: min(420px, 100%); accent-color: var(--ph-gold); }
.ph-henge-date { font-weight: 650; min-width: 12ch; }
.ph-swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.ph-swatch-set { background: #e8891c; }
.ph-swatch-rise { background: #3c62b8; }
.ph-aligned { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.92rem; }
.ph-sub { font-size: 1rem; margin: 16px 0 6px; }
.ph-100 th[scope="row"] { font-weight: 600; white-space: normal; min-width: 11rem; }
.ph-100 td { white-space: normal; }
.ph-100 td:first-child { color: var(--muted); }
.ph-feature h3 a { color: inherit; text-decoration: none; }
.ph-feature h3 a:hover { text-decoration: underline; }
.ph-100 a { color: inherit; }
