/* NWTF Giving Tuesday public site: rules that are new in the PHP build.
   Loaded after brand/*.css, css/pass4.css and css/v2.css (verbatim copies of the wireframe's baseline).
   Colors come only from the brand tokens (Onyx, Snow, Clay and the earth supports). No blue, no purple, no Sand
   fills in new components. Everything here replaces an inline style attribute the wireframe used, because the site's
   Content Security Policy forbids inline styles. */

/* Icon sprite: present in the page so <use href="#i-..."> works, but takes no space and is not announced. */
.v2-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-footer__logo {
  height: 5.75rem;
  width: auto;
}

.site-footer__tagline {
  height: 1.5rem;
  width: auto;
}

.site-narrow {
  max-width: 46rem;
}

/* Status tags on Onyx and on the hub tiles take the text color around them (the wireframe set color:inherit inline;
   css/v2.css already does this on Clay, on the dark meter and on the hub slides). */
.v2-dark .p4-tag,
.v2-hubtile .p4-tag {
  color: inherit;
}

/* Screen 06 hero photo placeholder (the wireframe's min-height:22rem). */
.site-media--tall {
  min-height: 22rem;
}

/* The meter without a public goal has no thermometer, so it is one column (the wireframe's grid-template-columns:1fr). */
.site-progress--single {
  grid-template-columns: 1fr;
}

/* Thermometer colors (the wireframe wrote them as fill and stroke values in the markup). The light card first, then the
   Onyx card. The fill height is an SVG attribute computed on the server. */
.site-thermo__glass {
  fill: var(--nwtf-theme-thermo-track);
  stroke: var(--nwtf-theme-text);
}

.site-thermo__neck {
  fill: var(--nwtf-theme-thermo-track);
}

.site-thermo__fill {
  fill: var(--nwtf-theme-thermo-fill);
}

.site-thermo__tick {
  stroke: var(--nwtf-theme-text);
}

.site-thermo__label {
  fill: var(--nwtf-theme-text);
}

.v2-progress--dark .site-thermo__glass {
  fill: var(--nwtf-theme-thermo-track-dark);
  stroke: var(--nwtf-color-brand-snow);
}

.v2-progress--dark .site-thermo__neck {
  fill: var(--nwtf-theme-thermo-track-dark);
}

.v2-progress--dark .site-thermo__tick {
  stroke: var(--nwtf-color-brand-snow);
}

.v2-progress--dark .site-thermo__label {
  fill: var(--nwtf-color-brand-snow);
}

/* Screen 11 without JavaScript: every hub shows, one under the other. js/hubs.js marks the carousel ready and shows
   one hub at a time. */
.v2-carousel:not(.is-ready) .v2-slide + .v2-slide {
  margin-top: var(--nwtf-space-4);
}

/* The honeypot field on the forms that store (guide 5.1, P-06a): moved off-screen, not display:none, which some bots
   skip. Its wrapper is aria-hidden and the field is out of the tab order, so people never see or reach it. */
.site-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Dev-only detail block (shown only when env is dev and debug is on). */
.site-debug {
  background: var(--nwtf-theme-card-bg);
  color: var(--nwtf-theme-text);
  border: 1px solid var(--nwtf-color-brand-onyx);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Google Places address suggestions (P-04p). Rendered, and filled by public/js/places.js, only while Places is on. The list
   is in the page flow (no overlay), so it never covers the fields below it or widens the page at 320px. */
.p4-places__list {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--nwtf-theme-card-bg);
  border: 1px solid var(--nwtf-color-brand-charcoal);
  border-radius: 10px;
  max-height: 16rem;
  overflow-y: auto;
}
.p4-places__option {
  padding: 0.625rem 0.75rem;
  color: var(--nwtf-color-brand-onyx);
  cursor: pointer;
  overflow-wrap: anywhere;
  border-left: 4px solid transparent;
}
.p4-places__option:hover,
.p4-places__option.is-active {
  border-left-color: var(--nwtf-theme-accent);
  font-weight: 600;
  text-decoration: underline;
}
.p4-places__attr {
  margin: 0.25rem 0 0;
  line-height: 1;
}
.p4-places__attr img {
  display: inline-block;
  max-width: 100%;
  height: 18px;
  width: auto;
}

/* P-07e: an approved hub photo (shown only when media.base_url is set). */
.v2-photo{margin:0;border-radius:var(--v2-radius-panel);overflow:hidden}
.v2-photo img{display:block;width:100%;height:auto;object-fit:cover}
.v2-photo figcaption{padding:.5rem 1rem;font-size:var(--nwtf-font-size-small)}
.v2-hubtile__photo{width:100%;height:100%;object-fit:cover}

/* P-26: rich text written in the admin editor (sanitized HTML; only these classes can reach the page). The four text colours are the brand palette, nothing else.
   Clay text must be 16px or larger (Snow on Clay is 4.52:1). */
.ql-align-center{text-align:center}
.ql-align-right{text-align:right}
.ql-align-justify{text-align:justify}
.ql-direction-rtl{direction:rtl;text-align:inherit}
.ql-size-small{font-size:.875em}
.ql-size-large{font-size:1.25em}
.ql-size-huge{font-size:1.6em}
.ql-indent-1{padding-left:3em}.ql-indent-2{padding-left:6em}.ql-indent-3{padding-left:9em}.ql-indent-4{padding-left:12em}
.ql-indent-5{padding-left:15em}.ql-indent-6{padding-left:18em}.ql-indent-7{padding-left:21em}.ql-indent-8{padding-left:24em}
.ql-color-onyx{color:var(--nwtf-color-brand-onyx)}
.ql-color-clay{color:var(--nwtf-color-brand-clay)}
.ql-size-small.ql-color-clay{font-size:1em}
.ql-color-charcoal{color:var(--nwtf-color-brand-charcoal)}
.ql-color-bark{color:var(--nwtf-color-brand-bark)}
.ql-syntax{white-space:pre-wrap;font-family:monospace}

/* P-26: a copy key printed as block HTML ($copyHtml) sits in a div that took the place of a paragraph. It keeps the paragraph's own spacing (the zero-specificity :where
   rule loses to any class, exactly as the element rule of a p did), and the paragraphs or lists inside it close up at the end. */
:where(.p4-copy){margin-top:0;margin-bottom:1rem}
.p4-copy>:last-child{margin-bottom:0}
.p4-note .p4-copy:last-child{margin-bottom:0}
:is(.v2-dark,.v2-slide,.v2-progress--dark) .p4-copy{color:var(--nwtf-color-text-inverse)}
.v2-step .p4-copy{margin:0;font-weight:var(--nwtf-font-weight-medium)}
.v2-hubtile .p4-copy{margin:0 0 var(--nwtf-space-3)}

/* Rich text on the page (hub story, landing lead, any $copyHtml block): .p4-rich is the story and lead container, .p4-copy the copy-key one. Same rules for both.
   Long words and links wrap instead of pushing the page sideways (320px), code scrolls inside its own box, and the first and last block close up. */
.p4-rich,.p4-copy{min-width:0;max-width:100%;overflow-wrap:anywhere}
.p4-rich>:first-child,.p4-copy>:first-child{margin-top:0}
.p4-rich>:last-child,.p4-copy>:last-child{margin-bottom:0}
.p4-rich p,.p4-copy p{margin:0 0 1rem}
.p4-rich p:empty,.p4-copy p:empty,.p4-rich p:has(>br:only-child),.p4-copy p:has(>br:only-child){margin:0;line-height:.75}
.p4-rich h2,.p4-rich h3,.p4-rich h4,.p4-rich h5,.p4-copy h2,.p4-copy h3,.p4-copy h4,.p4-copy h5{margin:1.25rem 0 .5rem;line-height:1.25}
.p4-rich h2,.p4-copy h2{font-size:1.5rem}
.p4-rich h3,.p4-copy h3{font-size:1.25rem}
.p4-rich h4,.p4-copy h4{font-size:1.125rem}
.p4-rich h5,.p4-copy h5{font-size:1rem}
.p4-rich ul,.p4-rich ol,.p4-copy ul,.p4-copy ol{margin:0 0 1rem;padding-left:1.5rem}
.p4-rich li>ul,.p4-rich li>ol,.p4-copy li>ul,.p4-copy li>ol{margin:.25rem 0 0}
.p4-rich li,.p4-copy li{margin:0 0 .25rem}
.p4-rich blockquote,.p4-copy blockquote{margin:0 0 1rem;padding:.25rem 0 .25rem 1rem;border-left:4px solid currentColor}
.p4-rich pre,.p4-copy pre{margin:0 0 1rem;padding:.75rem 1rem;max-width:100%;overflow-x:auto;border:1px solid currentColor;border-radius:10px;overflow-wrap:normal}
.p4-rich code,.p4-copy code{font-family:monospace;font-size:.9em;overflow-wrap:anywhere}
.p4-rich pre code,.p4-copy pre code{white-space:pre;overflow-wrap:normal}
.p4-rich pre.ql-syntax,.p4-copy pre.ql-syntax{white-space:pre}
.p4-rich sub,.p4-rich sup,.p4-copy sub,.p4-copy sup{font-size:.75em;line-height:0}
.p4-rich a,.p4-copy a{text-decoration:underline;overflow-wrap:anywhere}
/* On Onyx the four brand text colours would vanish (Onyx, Charcoal and Bark) or fall under 4.5:1 (Clay): the words keep the page's Snow. */
:is(.v2-dark,.v2-slide,.v2-progress--dark) :is(.p4-rich,.p4-copy) a{color:var(--nwtf-color-text-inverse)}
/* Every dark container, not only .v2-dark: the hub slide is Onyx too. Bold, coloured words and story headings keep the container's Snow (an Onyx swatch on bold text once stayed dark there). */
:is(.v2-dark,.v2-slide,.v2-progress--dark) :is(.p4-rich,.p4-copy) [class*="ql-color-"],:is(.v2-dark,.v2-slide,.v2-progress--dark) :is(.p4-rich,.p4-copy) :is(h2,h3,h4,h5,strong,em,u,s){color:inherit}
/* A deep indent leaves no room at 320px: past the second level the indent stops growing on a phone. */
@media (max-width:575.98px){
  .p4-rich .ql-indent-1,.p4-copy .ql-indent-1{padding-left:1.5em}
  .p4-rich .ql-indent-2,.p4-copy .ql-indent-2{padding-left:3em}
  .p4-rich [class*="ql-indent-"]:not(.ql-indent-1):not(.ql-indent-2),.p4-copy [class*="ql-indent-"]:not(.ql-indent-1):not(.ql-indent-2){padding-left:4.5em}
}
.v2-photo figcaption{overflow-wrap:anywhere}

/* Hub tile: the story shows as a short teaser (three lines at most), the photo placeholder sits at the top of the image area and the text block at the bottom, so the two
   never print over each other. The "Can't choose?" tile keeps its own text in full. */
.v2-hubtile__img{align-items:flex-start;padding:var(--nwtf-space-4) var(--nwtf-space-4) 0;text-align:center;overflow-wrap:anywhere}
.v2-hubtile__img:has(.v2-hubtile__photo){padding:0}
.v2-hubtile:not(.v2-hubtile--all) .v2-hubtile__body>h3{overflow-wrap:anywhere}
.v2-hubtile:not(.v2-hubtile--all) .v2-hubtile__body>p{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}

/* P-31 photo carousel: with no script every photo shows one under the other; carousel.js adds .is-ready to stack them and show the controls */
.v2-photos{position:relative}
.v2-photos__slides{display:grid;gap:var(--nwtf-space-3)}
.v2-photos.is-ready .v2-photos__slides{gap:0}
.v2-photos.is-ready .v2-photos__slide{grid-area:1/1;visibility:hidden}
.v2-photos.is-ready .v2-photos__slide.is-active{visibility:visible}
.v2-photos__slide img{height:auto;object-fit:contain}   /* the whole photo shows in its own shape; a wider or taller photo is never cropped */
.v2-photos.is-ready .v2-photos__slide{align-self:start}
/* P-31: thin arrows over the image, shown on hover and keyboard focus (faintly on touch); the glyph is white with a thin dark outline so it reads on any photo. No circle, border or fill. */
.v2-photos__halo{stroke:var(--nwtf-color-brand-onyx)}
.v2-photos__chev{stroke:var(--nwtf-color-brand-snow)}
.v2-photos__arrow{position:absolute;top:50%;z-index:2;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;padding:0;border:0;background:none;color:var(--nwtf-color-brand-snow);cursor:pointer;opacity:0;transition:opacity .2s ease}
.v2-photos__arrow[hidden]{display:none}
.v2-photos__arrow--prev{left:.25rem}
.v2-photos__arrow--next{right:.25rem}
.v2-photos:hover .v2-photos__arrow,.v2-photos:focus-within .v2-photos__arrow{opacity:1}
.v2-photos__arrow:focus-visible{outline:3px solid var(--nwtf-color-focus-ring-on-dark);outline-offset:-3px}
@media (hover:none){.v2-photos__arrow{opacity:.6}}
@media (prefers-reduced-motion:reduce){.v2-photos__arrow{transition:none}}
.v2-photos__icon{width:1.75rem;height:1.75rem}
/* a tile with a photo: the image on top (3:2), its credit directly under it, then the text */
.v2-hubtile--photo{justify-content:flex-start}
.v2-hubtile--photo .v2-hubtile__img{position:static;aspect-ratio:3/2;flex:none}
.v2-hubtile--photo .v2-hubtile__shade{display:none}
.v2-hubtile__credit{position:relative;margin:0;padding:var(--nwtf-space-2) var(--nwtf-space-4) 0;font-size:var(--nwtf-font-size-small);color:var(--nwtf-color-text-inverse);overflow-wrap:anywhere}
.v2-hubtile--photo .v2-hubtile__body{margin-top:auto}
.v2-landing-photos{padding-top:var(--nwtf-space-4)}

/* P-33 item 2: the thermometer's match. The two-tone style draws the match as a patterned upper part (never colour alone) with a text legend; the match caption lines sit under the figure. */
.site-thermo__match {
  fill: url(#site-thermo-hatch);
}

.site-thermo__hatch-bg {
  fill: var(--nwtf-theme-thermo-track);
}

.site-thermo__hatch {
  stroke: var(--nwtf-theme-thermo-fill);
}

.v2-progress--dark .site-thermo__hatch-bg {
  fill: var(--nwtf-color-brand-onyx);
}

.v2-progress__match {
  margin: var(--nwtf-space-3) 0 0;
  font-size: var(--nwtf-font-size-small);
}

.v2-progress__match + .v2-progress__match {
  margin-top: var(--nwtf-space-1);
}

.v2-progress__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nwtf-space-2) var(--nwtf-space-4);
  margin: var(--nwtf-space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--nwtf-font-size-small);
}

.v2-progress__legend li {
  display: flex;
  align-items: center;
  gap: var(--nwtf-space-2);
}

.v2-progress__swatch {
  flex: none;
  width: 1.5rem;
  height: 1rem;
  border: 2px solid var(--nwtf-theme-accent);
  border-radius: 4px;
}

.v2-progress__swatch--gifts {
  background: var(--nwtf-theme-thermo-fill);
}

.v2-progress__swatch--match {
  background: repeating-linear-gradient(135deg, var(--nwtf-theme-thermo-fill) 0 3px, var(--nwtf-theme-thermo-track) 3px 6px);
}

.v2-progress--dark .v2-progress__swatch--match {
  background: repeating-linear-gradient(135deg, var(--nwtf-theme-thermo-fill) 0 3px, var(--nwtf-color-brand-onyx) 3px 6px);
}

/* The impact block's uploaded image (hub_photos slot impact): fills the same panel the empty placeholder used, no dashed border. */
.v2-media--photo{display:block;margin:0;padding:0;border:0;overflow:hidden;min-height:0;background:var(--nwtf-color-brand-charcoal)}
.v2-media--photo .v2-media__img{display:block;width:100%;height:auto;max-height:32rem;object-fit:cover}
.v2-media--photo figcaption{padding:.5rem 1rem;text-align:left;overflow-wrap:anywhere}
