/* Shared light-theme card treatment across public V2 pages.
   On desktop lift and darken the light cards; on mobile the tint is muted. Never alter dark mode. */
html:not([data-theme="dark"]){
 --v2-card-rest:#fffefd;
 --v2-card-hover:#f1ebe2;
 --v2-card-mobile:#f9f7f2;
 --v2-card-border:#d8d0c5;
 --v2-card-border-hover:#c5b397;
}
/* Alternative colors remain available through the comparison links. */
html:not([data-theme="dark"])[data-card-tone="gray"]{
 --v2-card-rest:#f9f9f8;
 --v2-card-hover:#f1ebe2;
 --v2-card-mobile:#eeedea;
 --v2-card-border:#cfd0ce;
 --v2-card-border-hover:#bcbfbc;
}
html:not([data-theme="dark"])[data-card-tone="gold"]{
 --v2-card-rest:#fffefd;
 --v2-card-hover:#f1ebe2;
 --v2-card-mobile:#f9f7f2;
 --v2-card-border:#d8d0c5;
 --v2-card-border-hover:#c5b397;
}
html:not([data-theme="dark"])[data-card-tone="stone"]{
 --v2-card-rest:#f9faf9;
 --v2-card-hover:#f1ebe2;
 --v2-card-mobile:#edf0ee;
 --v2-card-border:#cad4cd;
 --v2-card-border-hover:#b5c3bd;
}
/* The three cards directly below the camera follow the same treatment. */
html:not([data-theme="dark"]) .hero-information{
 background:var(--v2-card-rest);
 transition:background-color .24s ease;
}
html:not([data-theme="dark"]) .hero-information>.hero-info-card{
 background:var(--v2-card-rest);
 transition:background-color .24s ease,transform .24s ease,border-color .24s ease,box-shadow .24s ease;
}
@media(hover:hover) and (pointer:fine){
 html:not([data-theme="dark"]) .hero-information>.hero-info-card:hover{
  background:var(--v2-card-hover);
  border-top-color:var(--v2-card-border-hover);
  transform:translateY(-3px);
  box-shadow:0 8px 22px rgba(44,48,48,.12);
 }
}
@media(max-width:767px), (hover:none) and (pointer:coarse){
 html:not([data-theme="dark"]) .hero-information,
 html:not([data-theme="dark"]) .hero-information>.hero-info-card{
  background:var(--v2-card-mobile);
 }
}
/* Restrict changes to content surfaces, not layout wrappers, imagery or editor UI. */
html:not([data-theme="dark"]) :is(
 .news-card,.news-slide,.news-archive-card,.daily-liturgy-card,.weekly-intentions-card,.home-announcements-card,
 .event-schedule-card,.obituary-home-card,.obituary-memory-card,
 .parish-service-tiles>a,.parish-useful-list>a,.info-card,.detail-card,
 .group-links>a,.document-links>a,.clergy-card,.clergy-entry,.history-row,
 .parish-history-link,.community-news-list>article,.community-news-list>.detail-card
){
 background-color:var(--v2-card-rest);
 border:1px solid var(--v2-card-border);
 border-radius:10px;
 transition:background-color .24s ease,transform .24s ease,box-shadow .24s ease,border-color .24s ease;
}
@media(hover:hover) and (pointer:fine){
 html:not([data-theme="dark"]) :is(
  .news-card,.news-slide,.news-archive-card,.daily-liturgy-card,.weekly-intentions-card,.home-announcements-card,
  .event-schedule-card,.obituary-home-card,.obituary-memory-card,
  .parish-service-tiles>a,.parish-useful-list>a,.info-card,.detail-card,
  .group-links>a,.document-links>a,.clergy-card,.clergy-entry,.history-row,
 .parish-history-link,.community-news-list>article,.community-news-list>.detail-card
 ):hover{
  background-color:var(--v2-card-hover);
  transform:translateY(-3px);
  box-shadow:0 9px 25px rgba(71,50,26,.09);
  border-color:var(--v2-card-border-hover);
 }
}
/* Touch-friendly light tint, without a simulated hover state. */
@media(max-width:767px), (hover:none) and (pointer:coarse){
 html:not([data-theme="dark"]) :is(
  .news-card,.news-slide,.news-archive-card,.daily-liturgy-card,.weekly-intentions-card,.home-announcements-card,
  .event-schedule-card,.obituary-home-card,.obituary-memory-card,
  .parish-service-tiles>a,.parish-useful-list>a,.info-card,.detail-card,
  .group-links>a,.document-links>a,.clergy-card,.clergy-entry,.history-row,
 .parish-history-link,.community-news-list>article,.community-news-list>.detail-card
 ){
  background-color:var(--v2-card-mobile);
  box-shadow:0 2px 12px rgba(71,50,26,.06);
 }
}
@media(prefers-reduced-motion:reduce){
 html:not([data-theme="dark"]) :is(
  .news-card,.news-slide,.news-archive-card,.daily-liturgy-card,.weekly-intentions-card,.home-announcements-card,
  .event-schedule-card,.obituary-home-card,.obituary-memory-card,
  .parish-service-tiles>a,.parish-useful-list>a,.info-card,.detail-card,
  .group-links>a,.document-links>a,.clergy-card,.clergy-entry,.history-row,
 .parish-history-link,.community-news-list>article,.community-news-list>.detail-card
 ){transition:none}
 html:not([data-theme="dark"]) :is(.news-card,.obituary-home-card,.obituary-memory-card,.parish-service-tiles>a):hover{transform:none}
}

@media(prefers-reduced-motion:reduce){
 html:not([data-theme="dark"]) .hero-information>.hero-info-card{transition:none}
 html:not([data-theme="dark"]) .hero-information>.hero-info-card:hover{transform:none}
}

/* Consistent restrained full outline on homepage sections with a gold top accent. */
html:not([data-theme="dark"]) :is(
 .weekly-intentions-card,.home-announcements-card,.daily-liturgy-card,.event-schedule-card
){
 border:1px solid var(--v2-card-border)!important;
 border-top:2px solid #c9b18b!important;
 border-radius:9px!important;
}
@media(hover:hover) and (pointer:fine){
 html:not([data-theme="dark"]) :is(
  .weekly-intentions-card,.home-announcements-card,.daily-liturgy-card,.event-schedule-card
 ):hover{
  border-color:var(--v2-card-border-hover)!important;
  border-top-color:#b69b72!important;
 }
}
/* Top three camera information panels share a single frame; separators are enough. */
html:not([data-theme="dark"]) .hero-information{
 border:1px solid #ded8ce;
}
html:not([data-theme="dark"]) .hero-information>.hero-info-card{
 border-radius:0;
 border-left:0;
 border-bottom:0;
}

/* Home-gallery images: the same framed, gently lifted treatment as content cards.
   Keep room above the photographs inside the horizontal scroll region so
   translateY does not get clipped by overflow-y:hidden. No change to lightbox. */
#parish-gallery.gallery-scroll-track > .gallery-thumb{
  position:relative;
  box-sizing:border-box;
  border:2px solid #d8d0c5!important;
  border-radius:16px;
  cursor:zoom-in;
  transition:transform .24s ease,border-color .24s ease,box-shadow .24s ease;
  box-shadow:0 3px 12px rgba(58,49,36,.10);
}
#parish-gallery.gallery-scroll-track > .gallery-thumb:focus-visible{
  outline:3px solid var(--gold);
  outline-offset:-3px;
}
html[data-theme="dark"] #parish-gallery.gallery-scroll-track > .gallery-thumb{
  border-color:#51575b!important;
}
@media(hover:hover) and (pointer:fine){
 #parish-gallery.gallery-scroll-track{
  padding-top:7px;
 }
 #parish-gallery.gallery-scroll-track > .gallery-thumb{
  height:calc(100% - 7px)!important;
 }
 #parish-gallery.gallery-scroll-track > .gallery-thumb:hover{
  transform:translateY(-5px);
  box-shadow:0 10px 25px rgba(58,49,36,.20);
  border-color:#bca783!important;
 }
 html[data-theme="dark"] #parish-gallery.gallery-scroll-track > .gallery-thumb:hover{
  border-color:#8c9499!important;
  box-shadow:0 10px 25px rgba(0,0,0,.36);
 }
}
@media(max-width:767px), (hover:none) and (pointer:coarse){
 #parish-gallery.gallery-scroll-track > .gallery-thumb{
  border-color:#d8d0c5!important;
  box-shadow:0 3px 12px rgba(58,49,36,.10);
 }
}
@media(prefers-reduced-motion:reduce){
 #parish-gallery.gallery-scroll-track > .gallery-thumb{transition:none}
 #parish-gallery.gallery-scroll-track > .gallery-thumb:hover{transform:none}
}

/* Consistent light footer: same background as the public page, separated
   by a fine rule rather than a dark block. Dark footer remains unchanged. */
html:not([data-theme="dark"]) body:not(.account-page) footer{
 background:var(--paper);
 color:var(--ink);
 border-top:1px solid #ddd6cc;
}
html:not([data-theme="dark"]) body:not(.account-page) footer :is(p,a){color:var(--ink)}
html:not([data-theme="dark"]) body:not(.account-page) footer :is(h2,h3){color:#785e39}
html:not([data-theme="dark"]) body:not(.account-page) footer :is(small,.footer-bottom){color:#62696c}
html:not([data-theme="dark"]) body:not(.account-page) footer .footer-bottom{border-top-color:#ded7cd}
html:not([data-theme="dark"]) body:not(.account-page) footer a:hover{color:#916d33}

/* The V2 dark palette uses charcoal, not the old navy navigation shade.
   Keep the transparent white navigation above the live hero untouched. */
html[data-theme="dark"]{
 --v1-menu-bg:#202224;
 --v1-menu-border:#45484a;
 --v1-menu-hover:#333639;
}
@media(max-width:1199px){
 html[data-theme="dark"] .header:not(.v2-scrolled):has(#main-nav.open){
  background:#202224;
  border-bottom-color:#45484a;
 }
}
/* Header after the hero and on interior pages must be opaque; retain the
   transparent hero overlay at the very top of the home page. */
html[data-theme="dark"] .header:is(.v2-scrolled,.v2-interior){
 background-color:#202224!important;
}

/* Unified public dark palette for late-loaded controls and media cards.
   Intention week controls previously inherited white backgrounds over white text. */
html[data-theme="dark"] main.content-page .week-navigation :is(.button,#intentions-pdf-download,[data-announcement-archive]){
 background-color:#27292b!important;
 color:#efede9!important;
 border-color:#555759!important;
}
html[data-theme="dark"] main.content-page .week-navigation :is(.button,#intentions-pdf-download,[data-announcement-archive]):hover{
 background-color:#383b3d!important;
 border-color:#777a7b!important;
}
html[data-theme="dark"] main.content-page .week-navigation :is(.button,[data-announcement-archive])[aria-pressed="true"]{
 box-shadow:inset 0 -3px #d7b77a;
}
/* Public album thumbnails have the same neutral frames as other dark cards. */
html[data-theme="dark"] :is(#album-content #album-photos .gallery-thumb,.parish-gallery:not(#parish-gallery) .gallery-thumb){
 border-color:#555759;
 background-color:#27292b;
}
/* The reading dialog is part of the public portal, not the old blue editor. */
html[data-theme="dark"] dialog.news-reader{
 background-color:#27292b;
 border-color:#555759;
 color:#efede9;
}
/* Submenus on interior pages must be opaque in both modes; the hero's
   white-on-transparent navigation remains unchanged until scrolling. */
.header:is(.v2-interior,.v2-scrolled) :is(.nav-submenu,#submenu-4){
 background-color:var(--v1-menu-bg);
 border-color:var(--v1-menu-border);
 color:var(--v1-menu-text);
}

/* Top navigation: highlight the hovered ITEM, never open a submenu on hover.
   The original underline animation remains; JS click/keyboard controls disclosure. */
.header :is(#main-nav > .quick-link,#main-nav > .nav-item > .nav-toggle){
 border-radius:8px;
 transition:background-color .2s ease,box-shadow .2s ease,border-color .2s ease;
}
@media(hover:hover) and (pointer:fine){
 html:not([data-theme="dark"]) .header:is(.v2-scrolled,.v2-interior) :is(#main-nav > .quick-link:hover,#main-nav > .nav-item > .nav-toggle:hover),
 html:not([data-theme="dark"]) .header:is(.v2-scrolled,.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
  background:#e9e2d7;
  box-shadow:inset 0 0 0 1px #d9cbb5;
 }
 html[data-theme="dark"] .header:is(.v2-scrolled,.v2-interior) :is(#main-nav > .quick-link:hover,#main-nav > .nav-item > .nav-toggle:hover),
 html[data-theme="dark"] .header:is(.v2-scrolled,.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
  background:#3a3e40;
  box-shadow:inset 0 0 0 1px #555b5e;
 }
 /* Transparent menu over the camera keeps white text/icons readable. */
 .header:not(.v2-scrolled):not(.v2-interior) :is(#main-nav > .quick-link:hover,#main-nav > .nav-item > .nav-toggle:hover),
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
  background:rgba(255,255,255,.24);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.31);
 }
}
/* Keyboard users can identify the selected item without triggering dropdowns. */
.header :is(#main-nav > .quick-link:focus-visible,#main-nav > .nav-item > .nav-toggle:focus-visible){
 outline:2px solid var(--v1-menu-icon);
 outline-offset:-2px;
}
@media(prefers-reduced-motion:reduce){
 .header :is(#main-nav > .quick-link,#main-nav > .nav-item > .nav-toggle){transition:none}
}

/* Dropdown carries the same surface as its selected top-navigation tile.
   Above the home camera the shared translucent tint remains translucent;
   on interior/scrolled menus use the corresponding solid light/dark hover. */
@media(min-width:1200px){
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]){
  background:rgba(255,255,255,.24);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.31);
  border-top:0;
  color:#fff;
  box-shadow:0 16px 34px rgba(11,24,35,.25);
 }
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]) :is(a,p[role="status"]){
  color:#fff!important;
  text-shadow:0 1px 3px rgba(0,0,0,.35);
 }
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]) a:is(:hover,:focus-visible){
  background:rgba(255,255,255,.17);
 }
}
html:not([data-theme="dark"]) .header:is(.v2-scrolled,.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]){
 background:#e9e2d7;
 border-color:#d9cbb5;
 box-shadow:0 14px 28px rgba(63,47,27,.14);
}
html[data-theme="dark"] .header:is(.v2-scrolled,.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]){
 background:#3a3e40;
 border-color:#555b5e;
 box-shadow:0 14px 28px rgba(0,0,0,.28);
}
html:not([data-theme="dark"]) .header:is(.v2-scrolled,.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]) a:is(:hover,:focus-visible){background:#ded3c3}
html[data-theme="dark"] .header:is(.v2-scrolled,.v2-interior) #main-nav .nav-item > .nav-submenu:not([hidden]) a:is(:hover,:focus-visible){background:#4a4f51}

/* Same color on the active group button and its opened submenu.
   Target the nested button explicitly (the nav item is the direct child). */
@media(hover:hover) and (pointer:fine){
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle:is(:hover,[aria-expanded="true"]){
  background:rgba(255,255,255,.24);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.31);
 }
 html:not([data-theme="dark"]) .header:is(.v2-interior,.v2-scrolled) #main-nav > .nav-item > .nav-toggle:is(:hover,[aria-expanded="true"]){
  background:#e9e2d7;
  box-shadow:inset 0 0 0 1px #d9cbb5;
 }
 html[data-theme="dark"] .header:is(.v2-interior,.v2-scrolled) #main-nav > .nav-item > .nav-toggle:is(:hover,[aria-expanded="true"]){
  background:#3a3e40;
  box-shadow:inset 0 0 0 1px #555b5e;
 }
}
/* Keep the selected tile visually attached to the submenu after clicking,
   including on touch devices and browsers without hover capability. */
.header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
 background:rgba(255,255,255,.24);
 box-shadow:inset 0 0 0 1px rgba(255,255,255,.31);
}
html:not([data-theme="dark"]) .header:is(.v2-interior,.v2-scrolled) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
 background:#e9e2d7;
 box-shadow:inset 0 0 0 1px #d9cbb5;
}
html[data-theme="dark"] .header:is(.v2-interior,.v2-scrolled) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
 background:#3a3e40;
 box-shadow:inset 0 0 0 1px #555b5e;
}
/* The transparent hero header uses a more specific legacy background reset. */
.header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"]{
 background-color:rgba(255,255,255,.24)!important;
}

/* One shared light-theme hover shade, sampled from homepage obituary cards.
   Keep card-specific lift, shadows, borders and interaction unchanged. */
@media(hover:hover) and (pointer:fine){
 html:not([data-theme="dark"]) :is(
  .hero-info-card,.news-card,.news-slide,.news-archive-card,.daily-liturgy-card,
  .weekly-intentions-card,.home-announcements-card,.event-schedule-card,
  .obituary-memory-card,.obituary-home-card,.info-card,.detail-card,
  .community-card,.community-news-list>article,.clergy-card,.clergy-entry,
  .history-row,.parish-history-link,.album-card,
  .parish-service-tiles>a,.parish-useful-list>a,
  .group-links>a,.document-links>a,
  .intentions-directory-page .intentions-day-card,
  .announcements-directory-page #weekly-items[data-archive="false"]:has(.weekly-announcement),
  .announcements-directory-page #weekly-items[data-archive="true"]>.weekly-announcement,
  .event-list,.mass-hours-section
 ):hover{
  background-color:#f1ebe2;
 }
}

/* A hovered dropdown link must remain readable even over a bright hero or
   homepage card. Keep normal submenu colors and the selected top tile intact. */
.header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-submenu:not([hidden]) > a:is(:hover,:focus-visible),
.header:is(.v2-scrolled,.v2-interior) #main-nav > .nav-item > .nav-submenu:not([hidden]) > a:is(:hover,:focus-visible){
 color:#000!important;
 background-color:#f1ebe2!important;
 text-shadow:none!important;
}

/* Shared dropdown geometry: consistent text inset and vertical rhythm.
   Wider desktop lists avoid unnecessary wrapping of long community names;
   mobile keeps its full-size touch targets and single scroll container. */
.header #main-nav > .nav-item > .nav-submenu > :is(a,p[role="status"]){
 display:block;
 box-sizing:border-box;
 margin:0;
 padding:10px 14px;
 line-height:1.5;
 text-align:left;
 white-space:normal;
 overflow-wrap:break-word;
}
@media(min-width:1200px){
 .header #main-nav > .nav-item > .nav-submenu:not([hidden]){
  width:300px;
  min-width:0;
  max-width:calc(100vw - 32px);
  padding:8px;
 }
 .header #main-nav > .nav-item > .nav-submenu > :is(a,p[role="status"]){
  min-height:40px;
  padding:10px 14px;
 }
}
@media(max-width:1199px){
 .header nav#main-nav.open > .nav-item > .nav-submenu:not([hidden]){
  padding:8px;
  border-width:1px;
  margin:0 10px 12px;
 }
 .header #main-nav > .nav-item > .nav-submenu > :is(a,p[role="status"]){
  min-height:44px;
 }
}

/* Match the hovered and opened desktop hero menu surfaces. */
@media(min-width:1200px){
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle[aria-expanded="true"],
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-submenu:not([hidden]){
  background-color:rgba(35,32,28,.55)!important;
 }
}
@media(min-width:1200px) and (not (pointer:coarse)){
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .quick-link:hover,
 .header:not(.v2-scrolled):not(.v2-interior) #main-nav > .nav-item > .nav-toggle:hover{
  background-color:rgba(35,32,28,.55)!important;
 }
}
