/* ==========================================================================
   Freemasonry in South Wales — shadcn-inspired design system (static HTML build)
   Colours retained from the original site:
     Navy dark   #353D57  (nav / primary)
     Navy light  #535E7E  (secondary surfaces / hover)
     Ink         #111111  (body text)
     Mauve       #7A6A6D  (accent / tags)
     Grey        #686868  (muted text)
   ========================================================================== */

:root{
  --background: 0 0% 100%;
  --foreground: 0 0% 7%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 7%;
  --primary: 226 24% 27%;          /* #353D57 */
  --primary-foreground: 0 0% 100%;
  --secondary: 224 22% 35%;        /* #535E7E */
  --secondary-foreground: 0 0% 100%;
  --muted: 220 14% 96%;
  --muted-foreground: 0 0% 41%;    /* #686868 */
  --accent: 8% 9% 46%;
  --accent-mauve: 6 8% 45%;        /* #7A6A6D */
  --border: 220 13% 89%;
  --input: 220 13% 89%;
  --ring: 226 24% 27%;
  --radius: 0.65rem;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3,h4{ font-family: "Manrope", sans-serif; font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p{ margin: 0; }
.container{ width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 1.5rem; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: .9rem;
  padding: .7rem 1.4rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover{ background: hsl(var(--secondary)); }
.btn-outline{ background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover{ background: rgba(255,255,255,.12); }
.btn-outline-dark{ background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-outline-dark:hover{ background: hsl(var(--muted)); }
.btn-lg{ padding: .9rem 1.9rem; font-size: 1rem; }
.btn-sm{ padding: .45rem 1rem; font-size: .82rem; }
.btn-block{ width: 100%; }

/* ---------- Badges ---------- */
.badge{
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .35rem .75rem; border-radius: 999px;
  background: hsl(var(--muted)); color: hsl(var(--primary));
  border: 1px solid hsl(var(--border));
}
.badge-on-dark{ background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.badge-mauve{ background: rgba(122,106,109,.12); color: #7A6A6D; border-color: rgba(122,106,109,.25); }

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: hsl(var(--primary));
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-row{ display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand{ display: flex; align-items: center; gap: .7rem; color: #fff; }
.brand img{ height: 40px; width: auto; }
.brand-text{ font-size: 1rem; font-weight: 800; line-height: 1.15; max-width: 220px; }
.brand-text span{ display:block; font-size: .7rem; font-weight: 600; opacity: .7; letter-spacing: .04em; }

.main-nav{ display: flex; align-items: center; gap: 2rem; }
.main-nav a{
  color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 600; letter-spacing: .02em;
  padding: .5rem 0; position: relative;
}
.main-nav a:hover{ color: #fff; }
.main-nav a.active{ color: #fff; }
.main-nav a.active::after{
  content:""; position: absolute; left:0; right:0; bottom:-2px; height: 2px; background: #fff; border-radius: 2px;
}
.nav-actions{ display:flex; align-items:center; gap: .75rem; }

.menu-toggle{
  display:none; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: .5rem;
  width: 44px; height: 44px; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
}
.menu-toggle span, .menu-toggle::before, .menu-toggle::after{ }
.menu-toggle svg{ color:#fff; width:20px; height:20px; }

.mobile-nav{ display:none; flex-direction: column; padding: .5rem 0 1.25rem; gap: .25rem; }
.mobile-nav a{ color:#fff; padding: .65rem .25rem; font-weight:600; border-bottom:1px solid rgba(255,255,255,.08); }
.mobile-nav .btn{ margin-top: .75rem; }

@media (max-width: 860px){
  .main-nav{ display: none; }
  .nav-actions .btn{ display:none; }
  .menu-toggle{ display:flex; }
  .site-header.open .mobile-nav{ display:flex; }
}

/* ---------- Hero ---------- */
.hero{
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--primary)) 0%, hsl(var(--secondary)) 100%);
}
.hero-grid{
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
  padding-block: 5rem 4.5rem;
}
.hero-copy .badge{ margin-bottom: 1.5rem; }
.hero h1{ font-size: clamp(2.1rem, 4vw, 3.1rem); margin-bottom: 1.1rem; }
.hero-copy p{ color: rgba(255,255,255,.82); font-size: 1.08rem; max-width: 34rem; margin-bottom: 2rem; }
.hero-actions{ display:flex; gap: .9rem; flex-wrap: wrap; }
.hero-media{ position: relative; }
.hero-media .frame{
  width: 100%;
  border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.55);
  aspect-ratio: 4/5;
}
.hero-media .frame img{ width:100%; height:100%; object-fit: cover; }
.hero-media .float-card{
  position:absolute; left: -1.25rem; bottom: -1.25rem;
  background: #fff; color: hsl(var(--foreground));
  border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.35);
  display:flex; align-items:center; gap: .75rem;
  max-width: 260px;
}
.float-card .dot{ width:10px; height:10px; border-radius:999px; background:#22c55e; flex-shrink:0; }
.float-card strong{ display:block; font-size: .95rem; }
.float-card span{ font-size: .78rem; color: hsl(var(--muted-foreground)); }

.hero-media .frame.carousel{ padding:0; }
.carousel-track{ position:relative; width:100%; height:100%; }
.carousel-slide{
  position:absolute; inset:0; opacity:0; visibility:hidden;
  transition: opacity .7s ease;
}
.carousel-slide.is-active{ opacity:1; visibility:visible; }
.carousel-slide img{ width:100%; height:100%; object-fit:cover; display:block; }

.carousel-arrow{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:2.4rem; height:2.4rem; border-radius:999px; border:none;
  background:rgba(0,0,0,.4); color:#fff; font-size:1.1rem; line-height:1;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: background .2s ease;
}
.carousel-arrow:hover{ background:rgba(0,0,0,.65); }
.carousel-arrow.prev{ left:.75rem; }
.carousel-arrow.next{ right:.75rem; }

.carousel-dots{
  position:absolute; right:.9rem; top:.9rem; z-index:2;
  display:flex; justify-content:center; gap:.4rem;
}
.carousel-dots button{
  width:8px; height:8px; border-radius:999px; border:none; padding:0;
  background:rgba(255,255,255,.5); cursor:pointer; transition: background .2s ease, transform .2s ease;
}
.carousel-dots button.is-active{ background:#fff; transform:scale(1.2); }

@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; padding-top: 3rem; }
  .hero-media{ order: -1; width: 100%; max-width: 380px; margin-inline:auto; }
  .hero-media .float-card{ display:none; }
}

/* ---------- Sections ---------- */
section{ padding: 5rem 0; }
.section-tight{ padding: 3.5rem 0; }
.section-muted{ background: hsl(var(--muted)); }
.section-dark{ background: hsl(var(--primary)); color: #fff; }
.section-head{ max-width: 640px; margin-bottom: 3rem; }
.section-head.center{ margin-inline: auto; text-align: center; }
.section-head .badge{ margin-bottom: 1rem; }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .85rem; }
.section-head p{ color: hsl(var(--muted-foreground)); font-size: 1.02rem; }
.section-dark .section-head p{ color: rgba(255,255,255,.78); }

/* ---------- Cards ---------- */
.card{
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1.9rem; box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover{ box-shadow: 0 20px 40px -28px rgba(20,20,30,.25); transform: translateY(-3px); border-color: transparent; }
.card-icon{
  width: 46px; height: 46px; border-radius: .6rem; display:flex; align-items:center; justify-content:center;
  background: hsl(var(--muted)); color: hsl(var(--primary)); margin-bottom: 1.1rem;
}
.card h3{ font-size: 1.08rem; margin-bottom: .55rem; }
.card p{ color: hsl(var(--muted-foreground)); font-size: .93rem; }

.grid{ display:grid; gap: 1.5rem; }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3, .grid-4{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px){ .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; } }

/* ---------- Values strip ---------- */
.values-strip{ border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.value-item{ display:flex; align-items:flex-start; gap: .9rem; }
.value-item .num{ font-weight: 800; font-size: 1.4rem; color: hsl(var(--secondary)); opacity:.5; }
.value-item h4{ font-size: 1rem; margin-bottom: .3rem; }
.value-item p{ font-size: .88rem; color: hsl(var(--muted-foreground)); }

/* ---------- Stats ---------- */
.stat{ text-align:center; }
.stat strong{ display:block; font-size: 2.1rem; font-weight: 800; }
.stat span{ font-size: .85rem; color: rgba(255,255,255,.75); }
.section-dark .stat strong{ color:#fff; }

/* ---------- Gallery ---------- */
.gallery-item{ border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; border: 1px solid hsl(var(--border)); }
.gallery-item img{ width:100%; height:100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img{ transform: scale(1.05); }

/* ---------- News ---------- */
.news-card{ display:flex; flex-direction:column; height:100%; }
.news-card .news-thumb{ border-radius: var(--radius); overflow:hidden; aspect-ratio: 16/10; margin-bottom: 1.1rem; background: hsl(var(--muted)); }
.news-card .news-thumb img{ width:100%; height:100%; object-fit:cover; }
.news-meta{ display:flex; align-items:center; gap:.6rem; font-size:.78rem; color: hsl(var(--muted-foreground)); margin-bottom:.6rem; }
.news-card h3{ font-size: 1.05rem; margin-bottom: .5rem; }
.news-card p{ color: hsl(var(--muted-foreground)); font-size: .9rem; flex-grow:1; }
.news-card .read-more{ margin-top: 1rem; font-size:.85rem; font-weight:700; color: hsl(var(--primary)); display:inline-flex; align-items:center; gap:.35rem; }
.news-card .read-more:hover{ gap:.55rem; }
.news-empty{ text-align:center; padding: 3rem 1rem; color: hsl(var(--muted-foreground)); border: 1px dashed hsl(var(--border)); border-radius: var(--radius); }

.news-article-hero{ aspect-ratio: 21/9; border-radius: var(--radius); overflow:hidden; margin-bottom: 2rem; background: hsl(var(--muted)); }
.news-article-hero img{ width:100%; height:100%; object-fit:cover; }
.article-body{ max-width: 700px; margin-inline:auto; }
.article-body p{ margin-bottom: 1.1rem; color: hsl(var(--foreground)); font-size: 1.02rem; }
.article-body h2{ margin: 2rem 0 1rem; font-size:1.4rem; }

/* ---------- CTA ---------- */
.cta{
  background: hsl(var(--primary)); color:#fff; border-radius: 1.25rem; padding: 3rem;
  display:flex; align-items:center; justify-content:space-between; gap: 2rem; flex-wrap: wrap;
}
.cta h2{ font-size: 1.7rem; margin-bottom: .5rem; }
.cta p{ color: rgba(255,255,255,.8); max-width: 30rem; }

/* ---------- Form ---------- */
.form-card{ background: hsl(var(--card)); border:1px solid hsl(var(--border)); border-radius: var(--radius); padding: 2.25rem; }
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid .full{ grid-column: 1 / -1; }
@media (max-width: 640px){ .form-grid{ grid-template-columns: 1fr; } }
.field label{ display:block; font-size:.85rem; font-weight:600; margin-bottom:.4rem; }
.field .req{ color:#b91c1c; }
.field input, .field select, .field textarea{
  width:100%; border:1px solid hsl(var(--input)); border-radius: .5rem; padding: .7rem .8rem;
  font-family: inherit; font-size: 1rem; background:#fff; color: hsl(var(--foreground));
}
.field input:focus, .field select:focus, .field textarea:focus{
  outline: 2px solid hsl(var(--secondary)); outline-offset: 1px; border-color: hsl(var(--secondary));
}
.field textarea{ resize: vertical; min-height: 110px; }
.checkbox-row{ display:flex; align-items:flex-start; gap:.6rem; }
.checkbox-row input{ margin-top: .2rem; width:auto; }
.checkbox-row label{ font-size:.85rem; color: hsl(var(--muted-foreground)); font-weight:400; }
.form-note{ font-size:.8rem; color: hsl(var(--muted-foreground)); margin-top:1rem; }
.form-success{
  display:none; align-items:flex-start; gap:.75rem; background: #ecfdf5; border:1px solid #a7f3d0;
  color:#065f46; border-radius: var(--radius); padding: 1rem 1.1rem; font-size:.9rem; margin-bottom:1.25rem;
}

/* ---------- Footer ---------- */
.site-footer{ background: #14161f; color: rgba(255,255,255,.75); padding: 3.5rem 0 1.75rem; }
.footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
@media (max-width: 800px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-brand{ display:flex; align-items:center; gap:.7rem; margin-bottom: 1rem; }
.footer-brand img{ height: 34px; }
.footer-brand strong{ color:#fff; font-size: .95rem; }
.site-footer h4{ color:#fff; font-size: .82rem; letter-spacing:.05em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-links{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.65rem; font-size:.88rem; }
.footer-links a:hover{ color:#fff; }
.footer-social{ display:flex; gap:.6rem; margin-top: .5rem; }
.footer-social a{
  width:36px; height:36px; border-radius:999px; border:1px solid rgba(255,255,255,.18);
  display:flex; align-items:center; justify-content:center;
}
.footer-social a:hover{ background: rgba(255,255,255,.08); }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.1); padding-top: 1.5rem; display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; font-size:.8rem; }

/* ---------- Page header (non-home pages) ---------- */
.page-header{ background: hsl(var(--primary)); color:#fff; padding: 3.5rem 0; }
.page-header .badge{ margin-bottom: 1rem; }
.page-header h1{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.page-header p{ color: rgba(255,255,255,.8); margin-top: .75rem; max-width: 40rem; }
.breadcrumb{ font-size:.82rem; color: rgba(255,255,255,.65); margin-bottom: 1rem; }
.breadcrumb a:hover{ color:#fff; }

/* ---------- Misc ---------- */
.prose p + p{ margin-top: 1rem; }
.divider{ height:1px; background: hsl(var(--border)); margin: 3rem 0; }
.icon-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap: 1rem; }
.icon-list li{ display:flex; gap:.75rem; align-items:flex-start; font-size:.95rem; }
.icon-list svg{ flex-shrink:0; color: hsl(var(--secondary)); margin-top:.15rem; }
