:root{
  --bg:#f6f4ef;
  --card:rgba(255,255,255,.86);
  --glass:rgba(255,255,255,.72);
  --ink:#1d2421;
  --muted:#4d5a55;
  --brand:#2e6b55;
  --brand2:#4a8b6c;
  --link:#1f5f4a;
  --linkHover:#134133;
  --line:rgba(20,30,24,.14);
  --shadow:0 14px 40px rgba(15,22,18,.12);
  --r:18px;

  --max:1200px;

  --bodyLink:#0e4636;
  --bodyLinkHover:#072b21;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(74,139,108,.22), transparent 50%),
    radial-gradient(1000px 600px at 85% 0%, rgba(46,107,85,.18), transparent 55%),
    var(--bg);
  color:var(--ink);
  line-height:1.55;
}

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

a{
  color:var(--link);
  text-decoration:none;
}

a:hover{
  color:var(--linkHover);
}

/* wrapper */
.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 18px;
}

/* header */
header{
  background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.38));
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(10px);
}

.banner{
  margin:18px 0 10px;
  border-radius:var(--r);
  overflow:hidden;
  box-shadow:var(--shadow);
}

/* navigation */
.nav{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 0 10px;
}

/* desktop nav links */
.navlinks{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  justify-content:center;
  margin:0 auto;
}

.navlinks a{
  font-size:16px;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}

.navlinks a:hover{
  color:var(--ink);
}

/* mobile menu toggle */
#menu-toggle{
  position:absolute;
  left:-9999px;
}

.menu-icon{
  display:none;
  width:44px;
  height:44px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  border:1px solid var(--line);
  box-shadow:0 10px 22px rgba(15,22,18,.12);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:6px;
  margin-left:auto;
}

.menu-icon span{
  width:20px;
  height:3px;
  background:var(--ink);
  border-radius:999px;
}

/* page spacing */
.page{padding-bottom:34px}
main{padding:18px 0 10px}

/* body links */
main a{
  color:var(--bodyLink);
  font-weight:600;
  text-decoration:underline;
  text-underline-offset:3px;
}

main a:hover{
  color:var(--bodyLinkHover);
  background-color:rgba(230,180,74,.18);
  border-radius:4px;
}

/* two column layout */
.layout{
  display:grid;
  gap:18px;
  grid-template-columns:minmax(0,1fr) 360px;
  align-items:stretch;
}

@media (max-width:980px){
  .layout{grid-template-columns:minmax(0,1fr)}
}

/* cards */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:18px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  height:100%;
}

.card hr{
  width:100%;
  border:0;
  border-top:1px solid var(--line);
  margin:14px 0;
  align-self:stretch;
}

/* only sidebar card uses flex */
aside.card{
  display:flex;
  flex-direction:column;
}

/* typography */
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6{
  margin:0 0 10px;
  line-height:1.2;
}

.card p,
.card ul,
.card ol{
  margin:0 0 12px;
  color:var(--muted);
}

.card p:last-child{margin-bottom:0}

.list-spaced li{
  margin:0 0 1em;
}

.list-spaced li:last-child{
  margin-bottom:0;
}

.small{
  font-size:13px;
  color:var(--muted);
}

/* floated media (image + short caption) */
.float-right{
  float:right;
  /* Table + caption: float width follows the image; caption wraps to match */
  display:table;
  max-width:calc(100% - 12px);
  margin:0 0 0 12px;
  box-sizing:border-box;
}

.float-right > a{
  display:table-cell;
}

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

.float-right .caption{
  display:table-caption;
  caption-side:bottom;
  margin:4px 0 10px;
}

@media (max-width:480px){
  .float-right{
    float:none;
    display:block;
    width:100%;
    max-width:100%;
    margin:0 0 16px;
  }

  .float-right > a{
    display:block;
  }

  .float-right .caption{
    display:block;
  }

  .float-right > a,
  .float-right img{
    width:100%;
  }
}

/* captions */
.caption{
  font-size:13px;
  color:var(--muted);
  text-align:center;
  font-weight:600;
  font-style:italic;
  margin:6px 0 12px;
}

.caption a:has(> img){
  display:block;
  width:fit-content;
  max-width:100%;
  margin-left:auto;
  margin-right:auto;
}

/* article page navigation */
.page-nav{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:0 1.25rem;
  text-align:center;
  margin:1em 0;
}

/* buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:999px;
  font-weight:800;
  font-size:14px;
  border:1px solid transparent;
  white-space:nowrap;
}

/* keyboard focus */
.btn:focus-visible{
  outline:2px solid rgba(46,107,85,.55);
  outline-offset:3px;
}

.btn.primary{
  color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow:0 16px 26px rgba(18,32,26,.14);
}

/* ghost button with visible outline */
.btn.ghost{
  color:var(--brand);
  background:rgba(255,255,255,.55);
  border:1px solid rgba(46,107,85,.55);
  box-shadow:0 16px 26px rgba(18,32,26,.08);
}

.btn.ghost:hover{
  background:rgba(74,139,108,.14);
  border-color:rgba(46,107,85,.80);
  color:var(--ink);
}

/* actions */
.actions{
  display:flex;
  gap:10px;
}

@media (max-width:768px){
  main .actions{
    flex-direction:column;
  }

  main .actions .btn{
    width:100%;
  }
}

/* video embeds */
.video{
  position:relative;
  width:100%;
  max-width:760px;
  margin-left:auto;
  margin-right:auto;
  aspect-ratio:16 / 9;
  border-radius:14px;
  border:1px solid var(--line);
  box-shadow:0 10px 28px rgba(15,22,18,.10);
  overflow:hidden;
  background:#0b1210;
}

.video iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

.video-facade{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  margin:0;
  border:0;
  cursor:pointer;
  background:#0b1210;
  display:block;
  appearance:none;
  -webkit-appearance:none;
  overflow:hidden;
}

.video .video-facade > img{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  object-fit:cover;
  object-position:center;
  transform:scale(1.04);
  transform-origin:center center;
  display:block;
}

.video-facade__play{
  position:absolute;
  left:50%;
  top:50%;
  width:68px;
  height:48px;
  margin:-24px 0 0 -34px;
  border-radius:14px;
  background:#c00;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
}

.video-facade__play::before{
  content:"";
  position:absolute;
  left:26px;
  top:14px;
  border-style:solid;
  border-width:10px 0 10px 16px;
  border-color:transparent transparent transparent #fff;
}

.video-facade:focus-visible{
  outline:3px solid #2f6f4e;
  outline-offset:2px;
}

/* callout */
.callout{
  background:rgba(255,255,255,.72);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  box-shadow:0 10px 28px rgba(15,22,18,.08);
  margin:14px 0;
}

/* =========================================================
   FOOTER
   Keeps existing vertical alignment
   Centres the middle block on medium and large screens
   ========================================================= */
.footerbar{
  margin:28px 0 22px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.footergrid{
  display:grid;
  gap:14px;
  grid-template-columns:auto 1fr auto;
  align-items:center;
}

/* Left block */
.footergrid > div:nth-child(1){
  text-align:left;
}

/* Centre block */
.footergrid > div:nth-child(2){
  text-align:center;
}

/* Right block (buttons) */
.footergrid > div:nth-child(3){
  text-align:right;
}

/* Buttons inside footer (works whether you use .actions or inline styles) */
.footergrid .actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-end;
}

.footergrid .actions .btn{
  height:40px;
  line-height:40px;
  width:auto;
  min-width:260px;
}

/* Responsive footer */
@media (max-width:900px){
  .footergrid{
    grid-template-columns:1fr;
    text-align:center;
    justify-items:center;
  }

  .footergrid > div:nth-child(1),
  .footergrid > div:nth-child(2),
  .footergrid > div:nth-child(3){
    text-align:center;
  }

  .footergrid .actions{
    width:100%;
    align-items:center;
  }

  .footergrid .actions .btn{
    width:100%;
    max-width:520px;
    min-width:0;
  }
}

/* =========================================================
   STANDARD MOBILE MENU
   ========================================================= */
@media (max-width:768px){

  .menu-icon{display:flex}

  .nav{
    flex-wrap:wrap;
    position:relative;
  }

  .navlinks{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:10px;

    max-height:0;
    overflow:hidden;
    opacity:0;
    pointer-events:none;
    transition:max-height .25s ease, opacity .2s ease;
    margin:0;
    padding:0;

    overflow-x:hidden;
  }

  #menu-toggle:checked ~ .navlinks{
    max-height:calc(100vh - 140px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;

    opacity:1;
    pointer-events:auto;
    margin-top:10px;
    padding-bottom:10px;
  }

  .navlinks a{
    display:block;
    width:100%;
    padding:10px 12px;
    border-radius:14px;
    border:1px solid rgba(20,30,24,.10);
    background:rgba(255,255,255,.72);
    text-align:left;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .navlinks a:hover{
    background:rgba(255,255,255,.86);
    color:var(--ink);
  }
}
