/* Theme values (colors, fonts, widths) arrive as CSS variables from the
   Appearance panel; see theme_css() in app/render.php. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

/* ------------------------------------------------------------ admin bar */

.admin-bar {
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center;
  padding: .45rem 1rem;
  background: #1d1838; color: #fff;
  font: 0.875rem/1.4 system-ui, sans-serif;
}
.admin-bar a { color: #e4c9f3; }
.admin-bar strong { color: #ffd479; font-weight: 600; }

/* ------------------------------------------------------------ header */

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "logo brand contact"
    "logo nav   nav";
  align-items: center;
  gap: .5rem 2rem;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 1rem;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 4px solid var(--rule);
}

.site-logo {
  grid-area: logo;
  width: clamp(84px, 11vw, 150px);
  aspect-ratio: 1;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--logo-fill);
  color: var(--header-text);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}
.site-logo--circle { border-radius: 50%; }
.site-logo--rounded { border-radius: 18%; }
.site-logo img { width: 100%; height: 100%; object-fit: cover; }

.site-brand { grid-area: brand; text-align: center; }

.site-name {
  font-family: var(--font-heading);
  font-style: var(--heading-style);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 1.05;
  color: inherit;
  text-decoration: none;
}

.site-tagline { margin: .25rem 0 0; font-family: var(--font-nav); }

.site-contact {
  grid-area: contact;
  display: flex; flex-direction: column; align-items: flex-end; gap: .15rem;
  font-style: normal;
  font-size: 0.95rem;
  text-align: right;
}
.site-contact a { color: inherit; text-decoration: none; }
.site-contact a:hover { text-decoration: underline; }

.nav-toggle { display: none; }

.site-nav {
  grid-area: nav;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  font-family: var(--font-nav);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem clamp(1rem, 3vw, 3rem); }
.site-nav a { color: inherit; text-decoration: none; padding: .25rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 2px; }

.site-nav .has-children { position: relative; }
.subnav {
  display: none !important;
  position: absolute; left: -1rem; top: 100%; z-index: 10;
  flex-direction: column;
  min-width: 12rem;
  padding: .5rem 1rem !important;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .12);
  font-size: 1rem;
}
.has-children:hover > .subnav,
.has-children:focus-within > .subnav { display: flex !important; }

/* ------------------------------------------------------------ main */

.site-main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 3rem;
}

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-family: var(--font-nav); font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumbs a { color: var(--muted); }

.page-title {
  font-family: var(--font-heading);
  font-style: var(--heading-style);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1.5rem;
}

.blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
.block--full { grid-column: 1 / -1; }

.block--text { max-width: 72ch; }
.block--text.block--half { max-width: none; }
.block--text > :first-child { margin-top: 0; }
.block--text h2, .block--text h3, .block--text h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; }
.block--text blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 4px solid var(--rule); color: var(--muted); }
.block--text ol > li[data-list="bullet"] { list-style-type: disc; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-size-small { font-size: .8em; }
.ql-size-large { font-size: 1.5em; }
.ql-size-huge { font-size: 2.2em; }
.ql-indent-1 { padding-left: 2em; } .ql-indent-2 { padding-left: 4em; } .ql-indent-3 { padding-left: 6em; }

/* ------------------------------------------------------------ galleries */

.gallery { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); gap: 1rem; }
.gallery__item { margin: 0; }
.gallery__item a { display: block; }
.gallery figcaption {
  margin-top: .5rem;
  font-family: var(--font-nav);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--muted);
}

.gallery--grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--tile-radius) / 2); }

.gallery--masonry { display: block; columns: var(--columns, 3); column-gap: 1rem; }
.gallery--masonry .gallery__item { break-inside: avoid; margin-bottom: 1rem; }
.gallery--masonry img { width: 100%; border-radius: calc(var(--tile-radius) / 2); }

.gallery--large { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.gallery--large .gallery__item { border: 3px solid var(--rule); background: var(--bg); }
.gallery--large img { width: 100%; }
.gallery--large figcaption { margin: 0; padding: .75rem 1rem; color: var(--text); border-top: 3px solid var(--rule); }

/* ------------------------------------------------------------ tiles */

.tiles { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); gap: clamp(.75rem, 2vw, 1.5rem); }

.tile {
  position: relative;
  display: flex; flex-direction: column;
  color: var(--text);
  text-decoration: none;
}
.tile__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: var(--surface);
}
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tile:hover .tile__media img { transform: scale(1.04); }

.tile__label {
  font-family: var(--font-nav);
  font-size: clamp(.95rem, 1.7vw, 1.45rem);
  line-height: 1.2;
}
.tiles[style*="--columns: 4"] .tile__label { font-size: clamp(.9rem, 1.3vw, 1.15rem); }

.tile__sub { display: block; font-size: .62em; opacity: .8; margin-top: .15em; }

.tile-label--pill .tile__label {
  position: absolute; left: 50%; bottom: 10%;
  transform: translateX(-50%);
  width: max-content; max-width: 88%;
  padding: .35em .9em;
  background: rgb(255 255 255 / .8);
  border-radius: 1.2em;
  text-align: center;
  overflow-wrap: anywhere;
}
.tile-label--bar .tile__label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .5em .75em;
  background: rgb(255 255 255 / .82);
  border-radius: 0 0 var(--tile-radius) var(--tile-radius);
  text-align: center;
}
.tile-label--below .tile__label { padding-top: .5rem; text-align: center; }

/* ------------------------------------------------------------ files */

.button {
  display: inline-block;
  padding: .65em 1.3em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-nav);
  text-decoration: none;
}
.button:hover { filter: brightness(1.15); }

.pdf-embed { width: 100%; height: min(85vh, 1100px); border: 3px solid var(--rule); }

/* ------------------------------------------------------------ footer */

.site-footer {
  border-top: 4px solid var(--rule);
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  color: var(--muted);
  font-family: var(--font-nav);
  font-size: .9rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

/* ------------------------------------------------------------ lightbox */

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgb(15 12 28 / .94);
  color: #fff;
}
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: transparent; }
.lightbox__stage { display: grid; place-items: center; min-height: 0; padding: 3.5rem 4rem 1rem; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__caption { padding: 0 1.5rem 1.5rem; text-align: center; font-family: var(--font-nav); font-size: .95rem; }
.lightbox button {
  position: absolute;
  background: rgb(255 255 255 / .12); color: #fff;
  border: 0; border-radius: 999px;
  width: 3rem; height: 3rem;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: rgb(255 255 255 / .25); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------ small screens */

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "logo brand toggle"
      "contact contact contact"
      "nav nav nav";
    gap: .75rem 1rem;
  }
  .site-logo { width: 64px; font-size: 1.2rem; }
  .site-brand { text-align: left; }
  .site-name { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .site-contact { align-items: flex-start; text-align: left; font-size: .875rem; }

  .nav-toggle {
    grid-area: toggle;
    display: block;
    padding: .5rem .9rem;
    border: 2px solid currentColor; border-radius: 999px;
    background: rgb(255 255 255 / .5); color: inherit;
    font: inherit; font-family: var(--font-nav);
  }
  .site-nav { display: none; flex-direction: column; gap: .25rem; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .subnav { display: flex !important; position: static; border: 0; box-shadow: none; background: transparent; color: inherit; padding: 0 0 0 1rem !important; min-width: 0; }

  .blocks { grid-template-columns: minmax(0, 1fr); }
  .gallery, .tiles { grid-template-columns: repeat(min(var(--columns, 3), 2), minmax(0, 1fr)); }
  .gallery--large { grid-template-columns: minmax(0, 1fr); }
  .gallery--masonry { columns: 2; }
  .lightbox__stage { padding: 3.5rem .5rem 1rem; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 1rem; transform: none; }
}
