/* ============================
   Variables
   ============================ */

:root{
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --ink: #2b2b2b;
  --muted: #555;
  --rule: rgba(0,0,0,0.12);
}

/* Base */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  background: #f4f1ea;
  position: relative;
}

/* Background layer */
body::before{
  content:"";
  position: fixed;
  inset: -2px;              /* was 0 */
  background: url("images/background-desktop.jpg") center top / cover no-repeat;
  z-index: -1;
}


/* Mobile background (easy to tune) */
@media (max-width: 768px){
  body::before{
    background-image: url("images/background-mobile.jpg");
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
  }
}




/* Layout */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
}

/* Images */

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

.image-left {
  float: left;
  margin: 0 0.5rem 0.5rem 0;
  max-width: 100px;
}

.image-right {
  float: right;
  margin: 0 0 0.5rem 1rem;
  max-width: 140px;
}

/* Crest page: float images neatly inside grid cards */
.crest-float {
  float: left;
  width: 100px;
  max-width: 100px;
  height: auto;
  margin: 0.15rem 0.85rem 0.35rem 0;
  display: inline-block;
}

.clear { clear: both; }

figure {
  margin: 0;
  padding: 0;
}

/* IMPORTANT: no forced width here (prevents layout conflicts with archive) */
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #aaa;
  padding: 4px;
  background: #fff;
  border-radius: 2px;
}

figcaption {
  margin: 0.25em 0 0 0;
  padding: 0;
  font-size: 0.85em;
  text-align: center;
}

figure.right {
  float: right;
  margin: 0 0 0.75em 1em;
}

/* Set width only for the right-floated portrait */
figure.right img { width: 220px; }

/* Portrait caption (top bio image) */
figure.portrait figcaption {
  font-size: 0.8rem;
  color: #666;
}

/* Desktop-specific sizing only for right-floated figures */
@media (min-width: 768px) {
  figure.right { max-width: 360px; }
}

/* Mobile: make right-floated figures stack and center cleanly */
@media (max-width: 768px) {

  figure.right {
    float: none;
    margin: 0 auto 0.75em auto;
    text-align: center;
    max-width: 100%;
  }

  figure.right img {
    width: 240px;
    margin: 0 auto;
  }

  figure.right figcaption { text-align: center; }
}

/* Archive image */

figure.archive {
  margin: 2.5rem auto;
  text-align: center;
  max-width: 320px;
}

figure.archive img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

figure.archive figcaption {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
  line-height: 1.3;
}

/* Desktop: float left + tidy wrap rhythm */
@media (min-width: 900px) {
  figure.archive {
    float: left;
    margin: 0.15rem 1.1rem 0.9rem 0;
    max-width: 280px;
    text-align: left;
  }

  figure.archive img {
    width: 100%;
    margin: 0;
  }

  figure.archive figcaption {
    text-align: center;
    margin-top: 0.4rem;
  }
}

/* Extended bio: contextual photo */

figure.bio-image {
  margin: 2rem auto;
  text-align: center;
  max-width: 520px;
}

figure.bio-image img {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

figure.bio-image figcaption {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
  line-height: 1.3;
  text-align: center;
}

/* Desktop: float left so text can flow */
@media (min-width: 900px) {
  figure.bio-image {
    float: left;
    max-width: 260px;
    margin: 0.15rem 1.1rem 0.9rem 0;
    text-align: left;
  }

  figure.bio-image figcaption { text-align: left; }
}

/* Links (body links) */

a {
  color: #7a1d1d;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease, background-color 0.15s ease;
}

a:hover,
a:focus {
  color: #9b1c1c;
  text-decoration-color: #9b1c1c;
}

/* Header */

header {
  background: rgba(244,241,234,0.90);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand:hover { cursor: pointer; }

.brand:focus {
  color: inherit;
  text-decoration: none;
}

/* Logo size */
.logo {
  height: 55px;
  width: auto;
}

@media (max-width: 768px) {
  .logo { height: 52px; }
}

.name {
  font-weight: 600;
  font-size: 18px;
}

.sub {
  font-size: 13px;
  color: #555;
}

/* ============================
   Nav + Hamburger
   ============================ */

/* Desktop nav baseline */
.nav{
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 13px;
  letter-spacing: .01em;
}

.nav a{
  border-bottom: 0;
  color: var(--muted);
  padding: 6px 2px;
  font-size: 13px;
  text-decoration: none;
}

/* Chip styling lives on spans (since your HTML uses <span> for every link) */
.nav a span{
  display: inline-block;
  padding: 6px 6px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover span,
.nav a:focus span{
  color: var(--ink);
  background: rgba(0,0,0,0.05);
  outline: none;
}

/* Desktop press feedback */
.nav a:active span{
  background: rgba(0,0,0,0.08);
}

/* Contact as a subtle CTA (desktop) */
.nav a.nav-cta span{
  color: #7a1d1d;
  border: 1px solid rgba(155,28,28,0.35);
  background: rgba(255,255,255,0.35);
  padding: 6px 12px;
  border-radius: 10px;
}

.nav a.nav-cta:hover span,
.nav a.nav-cta:focus span{
  background: rgba(155,28,28,0.10);
}

.nav a.nav-cta:active span{
  background: rgba(155,28,28,0.14);
}

/* Sitemap slightly quieter */
.nav a[href="sitemap.html"]{
  opacity: 0.85;
}

/* Optional: if you ever use class="active" on the <a> for current page */
.nav a.active span{
  background: rgba(0,0,0,0.07);
  color: var(--ink);
}

/* Mobile menu toggle */
.menu-toggle{
  display: none;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

/* Mid-width header tuning (prevents awkward wrap between desktop and mobile) */
@media (max-width: 940px) and (min-width: 769px){

  .header-inner{ gap: 12px; }

  .logo{ height: 52px; }

  .name{ font-size: 16px; }

  .sub{ font-size: 12px; }

  .nav{
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 12.5px;
  }

  .nav a{
    font-size: 12.5px;
    padding: 6px 1px;
  }
}

/* Mobile hamburger nav */
@media (max-width: 768px){

  .header-inner{
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .menu-toggle{
    display: block;
    margin-left: auto;
  }

  .nav{
    display: none;
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid var(--rule);
    padding: 8px 6px 4px;
  }

  .nav.open{ display: block; }

  /* Full-width tap area, but highlight only on the span chip */
  .nav a{
    display: block;
    padding: 4px 4px;     /* controls spacing between items */
    font-size: 14.5px;
    line-height: 1.08;    /* controls text tightness */
    background: none;
  }

  .nav a span{
    padding: 4px 10px;    /* chip height */
  }

  .nav a:hover span,
  .nav a:focus span{
    background: rgba(0,0,0,0.05);
  }

  .nav a:active span{
    background: rgba(0,0,0,0.09);
  }

  /* Keep Contact chip consistent on mobile */
  .nav a.nav-cta span{
    padding: 4px 12px;
  }

  .nav a.nav-cta:active span{
    background: rgba(155,28,28,0.14);
  }

  /* iOS tap highlight control */
  .nav a{
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* Hero */

.hero { padding: 55px 0 35px; }

.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 12px;
}

.lead {
  max-width: 680px;
  font-size: 18px;
  margin: 0 0 16px;
}

.tags { margin: 18px 0 18px; }

.tags span {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
  color: #444;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.primary {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #9b1c1c;
  color: #9b1c1c;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255,255,255,0.35);
  border-radius: 12px;
}

.primary:hover,
.primary:focus {
  background: rgba(155,28,28,0.10);
  text-decoration: none;
}

.text-link {
  color: #7a1d1d;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.text-link:hover,
.text-link:focus {
  color: #9b1c1c;
  text-decoration-color: #9b1c1c;
}

.note {
  margin-top: 14px;
  font-size: 14px;
  color: #555;
}

/* Grid */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 28px 0 10px;
}

.box {
  background: rgba(255,255,255,0.55);
  padding: 18px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
}

.box h2 {
  font-size: 16px;
  margin: 0 0 8px;
}

.box p { margin: 0 0 10px; }
.box p:last-child { margin-bottom: 0; }

.box.instructor { padding: 14px; }

/* Instructors */

.instructor-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.instructor-photo {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 2px;
  flex-shrink: 0;
  margin-right: 6px;
}

.instructor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%) contrast(0.95) brightness(1.05);
}

.instructor-meta {
  flex: 1;
  min-width: 0;
}

.instructor-meta h2 { margin: 0 0 6px; }

.instructor-meta .small {
  margin: 0;
  line-height: 1.35;
}

@media (max-width: 768px) {

  .instructor-head { gap: 8px; }

  .instructor-photo {
    width: 88px;
    height: 88px;
    margin-right: 6px;
  }
}

@media (min-width: 900px) {
  .instructor-meta .small { white-space: nowrap; }
}

/* Grounding & Membership */

.grounding,
.membership {
  max-width: 760px;
  margin: 34px auto;
}

.grounding { display: flow-root; }

.grounding p { margin: 0 0 14px; }

.membership h2 {
  font-size: 18px;
  margin: 0 0 10px;
}

.membership p { margin: 0 0 12px; }

.small {
  font-size: 14px;
  color: #555;
}

.search {
  font-size: 12px;
  color: #555;
}

@media (min-width: 900px) {
  .grounding p { margin: 0 0 0.9rem; }
}

/* CTA */

.cta {
  background: rgba(255,255,255,0.60);
  padding: 26px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  max-width: 760px;
  margin: 0 auto 54px;
}

.cta h2 {
  font-size: 18px;
  margin: 0 0 10px;
}

.cta p { margin: 0 0 14px; }

/* Paint containment */
.box,
.tags span,
.cta,
.membership {
  contain: paint;
}

/* Panels (crest page) */

.panel {
  background: rgba(255,255,255,0.60);
  padding: 22px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  max-width: 760px;
  margin: 0 auto 22px;
  display: flow-root;
}

.panel h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.panel p { margin: 0 0 12px; }

.panel .image-left,
.panel .image-right {
  border: 1px solid rgba(0,0,0,0.14);
  padding: 4px;
  background: #fff;
  border-radius: 2px;
}

.panel .image-left {
  max-width: 120px;
  margin: 0.2rem 1rem 0.6rem 0;
}

.panel .image-right {
  max-width: 170px;
  margin: 0.2rem 0 0.6rem 1rem;
}

@media (max-width: 768px) {
  .panel .image-left,
  .panel .image-right {
    float: none;
    display: block;
    margin: 0 auto 12px;
    max-width: 180px;
  }
}

/* ============================
   Footer utility (inside .grounding)
   ============================ */

.footer-utility{
  margin: 24px auto 34px;
}

/* Divider */
.footer-utility .content-end{
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 1rem;
}

/* Icons */
.footer-utility .social-links{
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.4rem;
}

.footer-utility .social-links a,
.footer-utility .social-links a:visited{
  color: var(--muted);
  text-decoration: none;
}

.footer-utility .social-links a:hover{
  color: var(--ink);
}

.footer-utility .social-links i{
  font-size: 1.3rem;
  line-height: 1;
}



/* ============================
   Mobile alignment fix
   ============================ */

@media (max-width: 768px){
  .footer-utility{
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Accessible hiding */
.footer-utility .visually-hidden{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================
   Footer utility (inside .grounding)
   ============================ */

.footer-utility{
  margin: 24px auto 34px;
}

/* Divider */
.footer-utility .content-end{
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 1rem;
}

/* Icons */
.footer-utility .social-links{
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.footer-utility .social-links a,
.footer-utility .social-links a:visited{
  color: var(--muted);
  text-decoration: none;
}

.footer-utility .social-links a:hover{
  color: var(--ink);
}

.footer-utility .social-links i{
  font-size: 1.5rem;
  line-height: 1;
}





/* Label */
.footer-utility .search{
  font-size: 12px;
  color: #555;
  margin: 0 0 0.35rem;
}

/* Search form — lock alignment */
.footer-utility form{
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

/* Search input */
.footer-utility input.search,
.footer-utility input[type="search"]{
  width: 180px;          /* adjust if needed */
  height: 28px;
  padding: 0 7px;

  font-size: 12px;
  line-height: 28px;     /* KEY: vertically centres text */

  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  font-family: var(--sans);
  margin: 0;
}

/* Search button */
.footer-utility .search-button{
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;

  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.footer-utility .search-button i{
  font-size: 13px;
  line-height: 1;
  display: block;
}

/* Button feedback */
.footer-utility .search-button:hover,
.footer-utility .search-button:focus{
  background: rgba(0,0,0,0.04);
  color: var(--ink);
}

.footer-utility .search-button:active{
  transform: translateY(1px);
}

/* ============================
   Mobile alignment fix
   ============================ */

@media (max-width: 768px){
  .footer-utility{
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Accessible hiding */
.footer-utility .visually-hidden{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* Footer */

footer {
  background: rgba(244,241,234,0.90);
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 10px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 0;
}

.footer-badge {
  height: 56px;
  width: auto;
  opacity: 0.9;
}

.footer-text {
  font-size: 14px;
  color: #333;
  line-height: 1.55;
}

.footer-kyokai {
  font-size: 13px;
  color: #555;
}

.footer-link {
  font-size: 13px;
  color: #555;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.footer-link:hover,
.footer-link:focus {
  color: #7a1d1d;
  text-decoration-color: #7a1d1d;
}

.footer-sep {
  color: #777;
  padding: 0 6px;
}

.copyright {
  font-size: 13px;
  color: #666;
  margin: 0;
  padding: 0 0 18px;
}

/* Mobile adjustments (nav/hamburger is handled above) */
@media (max-width: 768px) {

  .hero h1 { font-size: 30px; }

  .lead { font-size: 16.5px; }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

 }

/* ============================
   Rhys page only (magazine style)
   ============================ */

.rhys-page figure.left.contextual {
  float: left;
  margin: 0.15em 1.1em 0.9em 0;
  max-width: 320px;
}

.rhys-page figure.left.contextual img {
  width: 300px;
  max-width: 100%;
}

.rhys-page figure.left.contextual figcaption { text-align: center; }

@media (max-width: 768px) {
  .rhys-page figure.left.contextual {
    float: none;
    margin: 0 auto 0.9em auto;
    text-align: center;
    max-width: 100%;
  }

  .rhys-page figure.left.contextual img {
    width: 260px;
    margin: 0 auto;
  }

  .rhys-page figure.left.contextual figcaption { text-align: center; }
}
