/* ===========================================================================
   SILVER PRINT — Mobile layer  (linked with media="(max-width: 900px)")
   ---------------------------------------------------------------------------
   Complete replacement for assets/css/mobile-redesign.css, which is NOT
   loaded for this skin (manifest: "legacy_mobile_layer": false). Because that
   layer is gone, this file must also re-assert everything assets/css/style.css
   does inside its own max-width 900px block — otherwise the old dropdown
   panel nav comes back.

   900px is the single mobile cutoff and matches, exactly:
     - the media attribute the manifest declares
     - matchMedia('(max-width: 900px)') in assets/js/mobile-redesign.js:15
   CSS and behaviour therefore cannot disagree about what "mobile" means.

   assets/js/mobile-redesign.js is untouched, and it runs whatever the
   manifest says — the flag governs the stylesheet, not the script. This file
   styles the DOM that script injects:
     .mr-drawer-head with .mr-drawer-brand and .mr-drawer-close,
     .mr-backdrop, menu-open on BOTH html and body,
     mr-has-drawer-head on html,
     .mr-bottomnav with .mr-bn-item, .mr-bn-icon, .mr-bn-label, .is-active,
     and .gallery-tile.is-loaded.
   Leaving any of those unstyled is the failure mode this file exists to
   prevent; a bottom navigation bar with no rules is not invisible, it is a
   pile of unstyled links at the end of the page.

   TWO of the skin's three forced declarations live here, in section 1 and
   section 6. Each cancels an existing forced declaration and says so.
   =========================================================================== */

/* ---- 0. Motion first ---------------------------------------------------- */
/* Declared before anything animates, so the first paint is already calm. */

@media (prefers-reduced-motion: reduce) {
  body[data-skin="silver"] .nav,
  body[data-skin="silver"] .mr-backdrop,
  body[data-skin="silver"] .mr-bottomnav,
  body[data-skin="silver"] .mr-bn-item,
  body[data-skin="silver"] .gallery-tile {
    transition: none;
  }
  body[data-skin="silver"] .gallery-tile:not(.is-loaded) .tile-img-wrap::before {
    animation: none;
  }
}


/* ---- 1. Resets ---------------------------------------------------------- */

/* This file is only ever linked when the silver skin is active, so a bare
   html selector cannot leak into another skin. Deliberately not written with
   :has() — that is unsupported on older Android Chrome, which would silently
   drop the horizontal-overflow guard on exactly the devices that need it. */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body[data-skin="silver"] {
  overflow-x: hidden;
  /* The header becomes sticky and in-flow below, so the fixed-header offset
     that style.css applies has to come back off. */
  padding-top: 0;
  padding-bottom: calc(var(--s-bottomnav-h) + var(--s-safe-bottom) + var(--s-s2));
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;

  --s-header-h: 58px;
  --s-gutter: 16px;
}

/* FORCED COUNTER 1 of 3.
   assets/css/style.css ends with a max-width 600px rule that forces the body
   background to a light grey on every page. The whole point of this skin is
   that the page is white, so it has to be answered in kind. */
@media (max-width: 600px) {
  body[data-skin="silver"] {
    background: var(--s-paper-0) !important;
  }
}


/* ---- 2. Header ---------------------------------------------------------- */

body[data-skin="silver"] .header-wrap {
  position: sticky;
  top: 0;
  height: calc(var(--s-header-h) + var(--s-safe-top));
  padding-top: var(--s-safe-top);
  background: var(--s-paper-0);
  border-bottom: 1px solid var(--s-line);
  box-shadow: none;
}

body[data-skin="silver"] .header {
  padding-inline: var(--s-gutter);
}

body[data-skin="silver"] .brand-logo-img {
  height: 24px;
  max-width: 130px;
}

body[data-skin="silver"] .menu-btn {
  display: flex;
  gap: 5px;
  padding: 6px;
}

body[data-skin="silver"] .menu-btn .icon-bar {
  background: var(--s-ink-0);
  height: 2px;
  width: 22px;
  border-radius: 0;
  transition: transform var(--s-dur) var(--s-ease),
              opacity var(--s-dur-fast) var(--s-ease);
}


/* ---- 3. Drawer navigation ----------------------------------------------- */

/* Opened by EITHER the checkbox — which still works with JavaScript off —
   OR menu-open on html, which the script sets. Both paths are listed on
   every rule for that reason. */

body[data-skin="silver"] .nav {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  inset-inline-start: auto;
  width: min(84vw, 340px);
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 0 calc(var(--s-safe-bottom) + var(--s-s5));
  background: var(--s-paper-0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  border-inline-start: 1px solid var(--s-line-strong);
  box-shadow: none;
  display: flex;
  opacity: 1;
  transform: translateX(100%);
  transition: transform var(--s-dur) var(--s-ease);
  z-index: 1200;
  overflow-y: auto;
}

html[dir="rtl"] body[data-skin="silver"] .nav {
  transform: translateX(-100%);
}

body[data-skin="silver"] #menu-toggle:checked ~ .nav,
html.menu-open body[data-skin="silver"] .nav,
html[dir="rtl"] body[data-skin="silver"] #menu-toggle:checked ~ .nav,
html[dir="rtl"].menu-open body[data-skin="silver"] .nav {
  transform: translateX(0);
  display: flex;
  opacity: 1;
}

body[data-skin="silver"] .mr-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-s3);
  padding: calc(var(--s-safe-top) + var(--s-s4)) var(--s-s5) var(--s-s4);
  border-bottom: 1px solid var(--s-line-strong);
  background: var(--s-paper-0);
  position: sticky;
  top: 0;
  z-index: 1;
}

body[data-skin="silver"] .mr-drawer-brand {
  font-family: var(--s-font-display);
  font-size: 1.125rem;
  font-weight: var(--s-fw-black);
  letter-spacing: .04em;
  color: var(--s-ink-0);
}

body[data-skin="silver"] .mr-drawer-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--s-line-strong);
  border-radius: 0;
  color: var(--s-ink-0);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body[data-skin="silver"] .mr-drawer-close:hover {
  background: var(--s-paper-2);
  border-color: var(--s-line-heavy);
}

body[data-skin="silver"] .nav-link {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: var(--s-s3) var(--s-s5);
  border: 0;
  border-bottom: 1px solid var(--s-line);
  border-inline-start: 3px solid transparent;
  font-size: .9375rem;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--s-text);
}

body[data-skin="silver"] .nav-link:hover,
body[data-skin="silver"] .nav-link.active {
  background: var(--s-paper-2);
  border-bottom-color: var(--s-line);
  border-inline-start-color: var(--s-ink-0);
  color: var(--s-ink-0);
}

body[data-skin="silver"] .mr-backdrop {
  position: fixed;
  inset: 0;
  background: var(--s-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--s-dur) var(--s-ease);
  z-index: 1100;
}

/* The backdrop is appended to body by the script, so the scoped selector
   already reaches it; an unscoped duplicate would only be a rule that can
   escape this skin. */
html.menu-open body[data-skin="silver"] .mr-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Scroll lock. The script sets menu-open on BOTH html and body. */
html.menu-open,
html.menu-open body[data-skin="silver"] {
  overflow: hidden;
}


/* ---- 4. Bottom navigation ----------------------------------------------- */

/* Injected by assets/js/mobile-redesign.js on every page under 900px,
   regardless of the manifest flag. Without this section it would render as
   four unstyled links stacked at the foot of the document. */

body[data-skin="silver"] .mr-bottomnav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--s-bottomnav-h) + var(--s-safe-bottom));
  padding-bottom: var(--s-safe-bottom);
  background: var(--s-paper-0);
  border-top: 1px solid var(--s-line-strong);
  box-shadow: none;
  transition: transform var(--s-dur) var(--s-ease);
}

body[data-skin="silver"] .mr-bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 48px;
  text-decoration: none;
  color: var(--s-ink-2);
  transition: color var(--s-dur-fast) var(--s-ease);
}

body[data-skin="silver"] .mr-bn-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

/* The script's icons are stroke-only SVG that inherit currentColor, so the
   item colour is the only thing that has to change between states. */
body[data-skin="silver"] .mr-bn-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-skin="silver"] .mr-bn-label {
  font-size: .6875rem;
  font-weight: var(--s-fw-med);
  letter-spacing: .01em;
}

/* Active is marked twice — by ink and by weight — because a single step of
   grey is not enough on a phone screen in daylight. */
body[data-skin="silver"] .mr-bn-item.is-active {
  color: var(--s-ink-0);
}

body[data-skin="silver"] .mr-bn-item.is-active .mr-bn-label {
  font-weight: var(--s-fw-semi);
}

body[data-skin="silver"] .mr-bn-item:focus-visible {
  outline: var(--s-ring);
  outline-offset: -2px;
}

/* Out of the way while the drawer is open or the chrome is hidden. */
html.menu-open body[data-skin="silver"] .mr-bottomnav,
body[data-skin="silver"].mr-chrome-hidden .mr-bottomnav {
  transform: translateY(100%);
}


/* ---- 5. Gallery --------------------------------------------------------- */

body[data-skin="silver"] .gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-s3);
}

@media (min-width: 600px) {
  body[data-skin="silver"] .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-s4);
  }
}

body[data-skin="silver"] .gallery-tile.clean-tile,
body[data-skin="silver"] .gallery-tile {
  gap: var(--s-s2);
}

body[data-skin="silver"] .tile-title {
  font-size: .8125rem;
  -webkit-line-clamp: 1;
}

body[data-skin="silver"] .tile-tags {
  display: none;
}

/* Skeleton until the script adds is-loaded. It re-attaches to tiles that
   arrive through infinite scroll, so this covers those too. */
body[data-skin="silver"] .gallery-tile:not(.is-loaded) .tile-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    var(--s-paper-2) 0%,
    var(--s-paper-3) 50%,
    var(--s-paper-2) 100%);
  background-size: 200% 100%;
  animation: silver-shimmer 1.4s linear infinite;
}

body[data-skin="silver"] .gallery-tile:not(.is-loaded) img {
  opacity: 0;
}

body[data-skin="silver"] .gallery-tile.is-loaded .tile-img-wrap::before {
  display: none;
}

@keyframes silver-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

body[data-skin="silver"] .feat-grid,
body[data-skin="silver"] .behind-grid {
  gap: var(--s-s3);
}


/* ---- 6. Home search block ----------------------------------------------- */

/* FORCED COUNTER 2 of 3.
   assets/css/index-page.css hides the hero banner outright under 600px, to
   save space for a mobile layer this skin no longer loads. On a photography
   site the one photograph at the top of the home page is worth its 85 pixels,
   so it comes back — and the hiding rule is forced, so this has to be. */
@media (max-width: 600px) {
  body[data-skin="silver"] .search-hero-banner {
    display: flex !important;
    min-height: 0;
    max-height: 140px;
  }
}

body[data-skin="silver"] .search-command {
  margin-block: var(--s-s4) var(--s-s6);
}

body[data-skin="silver"] .search-tags-row {
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
  padding-inline: var(--s-s4);
}

body[data-skin="silver"] .search-tags-row::-webkit-scrollbar {
  display: none;
}

/* The base sheet turns this row into a dark translucent pill on phones. It
   stays the same white instrument it is on the desktop, only stacked. */
body[data-skin="silver"] .search-controls-row {
  flex-direction: column;
  align-items: stretch;
  background: var(--s-paper-0);
  border: 1px solid var(--s-line-strong);
  border-top: 0;
  border-radius: 0;
  box-shadow: none;
}

/* .cd-dropdown is in this list because the native selects beside it are
   display:none — JavaScript swaps a widget in front of each one. Leaving it
   out is what left the two filters as short floating boxes on the desktop. */
body[data-skin="silver"] .search-input-wrap,
body[data-skin="silver"] .search-filter-select,
body[data-skin="silver"] .search-controls-row .cd-dropdown,
body[data-skin="silver"] .search-discover-btn {
  min-height: 52px;
  width: 100%;
}

body[data-skin="silver"] .search-controls-row .cd-trigger {
  min-height: 52px;
}

body[data-skin="silver"] .search-controls-row .search-divider {
  width: auto;
  height: 1px;
  align-self: stretch;
}

body[data-skin="silver"] .search-hero-input {
  font-size: 1rem;
}

body[data-skin="silver"] .search-bottom-area {
  padding: 0;
  margin-top: 0;
}


/* ---- 7. Page-level trims ------------------------------------------------ */

body[data-skin="silver"] .container {
  padding-inline: var(--s-gutter);
}

body[data-skin="silver"] .modern-section-title {
  margin-block: var(--s-s7) var(--s-s6);
}

body[data-skin="silver"] .modern-section-title h2 {
  font-size: clamp(1.75rem, 1.2rem + 3vw, 2.5rem);
}

body[data-skin="silver"] .ph-hero {
  padding: var(--s-s5) var(--s-gutter) var(--s-s6);
}

body[data-skin="silver"] .ph-body {
  padding: var(--s-s6) var(--s-gutter) var(--s-s7);
}

body[data-skin="silver"] .story-title {
  font-size: clamp(1.75rem, 1.2rem + 4vw, 2.75rem);
}

body[data-skin="silver"] .sp-grid {
  gap: var(--s-s3);
}

body[data-skin="silver"] .sfd-grid {
  gap: var(--s-s5);
}

body[data-skin="silver"] .sfd-grid > .sfd-col + .sfd-col:not(.sfd-col--quick) {
  border-inline-start: 0;
  border-top: 1px solid var(--s-line-on-ink);
  padding-top: var(--s-s5);
}

/* The footer is the last thing on the page and the bottom bar sits over it. */
body[data-skin="silver"] .sfd-base,
body[data-skin="silver"] .footer {
  padding-bottom: calc(var(--s-bottomnav-h) + var(--s-s4));
}
