/*
Theme Name: DessetLogic /ME
Theme URI: https://dessetlogic.me
Author: DessetLogic /ME
Description: Custom theme for DessetLogic /ME. Managed IT, security and cloud services, built around the tagline "Logic Behind Every System."
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dessetlogic
*/

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root{
  --ink: #10151C;
  --navy: #13294B;
  --navy-2: #1C3A63;
  --paper: #F7F8FA;
  --paper-2: #EDEFF3;
  --line: #C7CDD6;
  --line-soft: #DDE1E7;
  --teal: #2FB8AC;        /* accent lines / non-text only */
  --teal-dim: #14706A;    /* teal for TEXT - AA contrast on paper */
  --amber: #E8641C;       /* accent only */
  --amber-deep: #C4520F;  /* amber for BUTTON BACKGROUNDS - AA with white */
  --white: #FFFFFF;
  --muted: #5B6470;
  --footer-text: #AEB6C2;
  --footer-dim: #7E8898;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max-w: 1180px;
  --gutter: 28px;
  --radius: 2px;
  --header-h: 74px;
}

/* ============================================
   RESET / BASE
   ============================================ */
*, *::before, *::after{ box-sizing: border-box; }
html{
  scroll-behavior: smooth;
  /* keep in-page anchors clear of the sticky header */
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* belt-and-braces against any single element overflowing on narrow screens */
  overflow-x: hidden;
}
img, svg, video{ max-width:100%; }
img{ display:block; height:auto; }
a{ color: inherit; text-decoration:none; }

/* Scoped list reset - chrome only. Editor content keeps real list styling
   (see .entry-content further down). */
.main-nav ul,
.footer-grid ul,
.why-list,
.node-list,
.comment-list,
.nav-links ul{ list-style:none; margin:0; padding:0; }

h1,h2,h3,h4,h5,h6{
  font-family: var(--font-display); margin:0 0 .5em;
  font-weight:600; letter-spacing:-0.01em;
  /* headings inherited body's 1.6 and read as loosely-spaced blocks */
  line-height: 1.2;
}
p{ margin:0 0 1em; color: var(--muted); }
:focus-visible{ outline: 2px solid var(--teal-dim); outline-offset: 3px; }

.container{ max-width: var(--max-w); margin: 0 auto; padding-inline: var(--gutter); }

/* ============================================
   ACCESSIBILITY HELPERS (required by WordPress)
   ============================================ */
.screen-reader-text{
  border:0;
  clip-path: inset(50%);
  height:1px; width:1px;
  margin:-1px; padding:0;
  overflow:hidden;
  position:absolute !important;
  white-space:nowrap;
}
.screen-reader-text:focus{
  clip-path:none;
  background: var(--white);
  color: var(--navy);
  display:block;
  font-family: var(--font-mono);
  font-size:14px;
  height:auto; width:auto;
  padding:14px 22px;
  inset-inline-start:10px; top:10px;
  line-height:normal;
  text-decoration:none;
  z-index:100000;
  box-shadow:0 2px 8px rgba(16,21,28,.2);
}
.skip-link{ position:absolute; }

/* ============================================
   SHARED BITS
   ============================================ */
.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 14px;
}
.eyebrow-center{ text-align:center; }

.grid-bg{
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header{
  position: sticky; top:0; z-index: 100;
  background: rgba(247,248,250,0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .container{
  display:flex; align-items:center; justify-content:space-between;
  gap: 16px;
  min-height: var(--header-h);
}
.brand{
  display:flex; align-items:baseline;
  font-family: var(--font-display); font-weight:700; font-size:19px; color: var(--navy);
  flex: 0 1 auto; min-width:0;
}
.brand-name{ white-space:nowrap; }
/* "/ME" is part of the company name, set in the mono face for accent */
.brand .bracket{
  color: var(--teal-dim);
  font-family: var(--font-mono);
  font-weight:400;
}
.brand-tag{
  font-family: var(--font-mono); font-size:11px; color: var(--muted);
  letter-spacing:.04em; display:none;
  white-space:nowrap;
  /* a drawn rule replaces the dash character that used to separate these */
  margin-inline-start:12px;
  padding-inline-start:12px;
  border-inline-start:1px solid var(--line);
}
.custom-logo-link{ display:flex; align-items:center; }
.custom-logo{ max-height: 42px; width:auto; }

.main-nav{ flex: 0 1 auto; }
.main-nav > ul{ display:flex; gap: 34px; align-items:center; }
.main-nav a{
  display:inline-block;
  font-size: 14px; font-weight:500; color: var(--ink);
  position:relative; padding: 6px 0;
}
.main-nav a::after{
  content:""; position:absolute; inset-inline:0; bottom:0; height:2px;
  background: var(--teal); transform: scaleX(0); transform-origin:left;
  transition: transform .2s ease;
}
.main-nav a:hover::after,
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after,
.main-nav .current-menu-ancestor > a::after,
.main-nav a[aria-current="page"]::after{ transform: scaleX(1); }

/* Submenus - must NOT inherit the top-level flex row */
.main-nav .sub-menu{
  display:block;
  position:absolute; top:100%; inset-inline-start:0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  padding: 8px 0;
  box-shadow: 0 6px 20px rgba(16,21,28,.08);
  opacity:0; visibility:hidden;
  transition: opacity .15s ease, visibility .15s ease;
}
.main-nav > ul > li{ position:relative; }
.main-nav > ul > li:hover > .sub-menu,
.main-nav > ul > li:focus-within > .sub-menu{ opacity:1; visibility:visible; }
.main-nav .sub-menu a{ display:block; padding: 8px 18px; font-size:13.5px; }
.main-nav .sub-menu a::after{ display:none; }
.main-nav .sub-menu a:hover{ background: var(--paper-2); color: var(--navy); }

.header-cta{
  font-family: var(--font-mono); font-size:13px; font-weight:500;
  border: 1px solid var(--navy); color: var(--navy);
  padding: 9px 18px; border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
  white-space:nowrap; flex: 0 0 auto;
}
.header-cta:hover{ background: var(--navy); color: var(--white); }

.nav-toggle{
  display:none; background:none; border:none; cursor:pointer;
  padding:6px; margin-inline-start:auto; color: var(--navy);
  flex: 0 0 auto;
}
/* Two-class specificity so this isn't overridden by `.btn{display:inline-flex}`,
   which is declared later in the file. */
.main-nav .nav-cta{ display:none; }

/* Brand tagline only appears well ABOVE the mobile-nav breakpoint so it can
   never share the row with the hamburger. */
@media(min-width: 1000px){ .brand-tag{ display:inline; } }

@media(max-width: 880px){
  .main-nav{
    display:none;
    position:absolute; top:100%; inset-inline:0;
    background:var(--paper);
    border-bottom:1px solid var(--line-soft);
    padding: 18px var(--gutter) 22px;
    box-shadow: 0 8px 20px rgba(16,21,28,.06);
  }
  .main-nav.is-open{ display:block; }
  .main-nav > ul{ flex-direction:column; gap:4px; align-items:stretch; }
  .main-nav a{ display:block; padding: 10px 0; font-size:15px; }
  .main-nav a::after{ display:none; }
  .main-nav .current-menu-item > a,
  .main-nav .current_page_item > a,
  .main-nav a[aria-current="page"]{ color: var(--teal-dim); }
  /* submenus expand inline on mobile */
  .main-nav .sub-menu{
    position:static; opacity:1; visibility:visible;
    border:none; box-shadow:none; background:transparent;
    padding: 0 0 0 16px; min-width:0;
  }
  .main-nav .sub-menu a{ padding: 8px 0; }
  .main-nav .sub-menu a:hover{ background:transparent; }

  /* The header CTA moves inside the panel instead of crowding the bar */
  .header-cta{ display:none; }
  .main-nav .nav-cta{ display:inline-flex; margin-top: 14px; }
  .nav-toggle{ display:block; }
}

/* ============================================
   HERO
   ============================================ */
.hero{
  position:relative;
  /* the node strip already adds 60px of breathing room below the buttons, so
     a big bottom pad on top of the next section's 88px read as dead space */
  padding: 110px 0 56px;
  overflow:hidden;
  background: var(--paper);
}
.hero::after{
  content:"";
  position:absolute; inset:0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
  pointer-events:none;
}
/* If masks aren't supported the grid would sit as a hard full-bleed block -
   fade it out instead. */
@supports not ((-webkit-mask-image: radial-gradient(black, transparent)) or (mask-image: radial-gradient(black, transparent))){
  .hero::after{ opacity:.35; }
}
.hero-inner{ position:relative; z-index:2; max-width: 760px; margin:0 auto; text-align:center; }
.hero h1{
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  color: var(--navy); line-height:1.05; margin-bottom:.4em;
  overflow-wrap: break-word;
}
.hero .tagline{
  font-family: var(--font-mono); font-size: 15px; color: var(--teal-dim);
  letter-spacing:.04em; margin-bottom: 22px;
}
.hero p.lede{ font-size: 17px; max-width: 620px; margin: 0 auto 34px; color: var(--muted); }
.hero-actions{ display:flex; gap:16px; justify-content:center; flex-wrap:wrap; }

@media(max-width:600px){
  .hero{ padding: 68px 0 60px; }
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-mono); font-size: 13.5px; font-weight:500;
  padding: 13px 26px; border-radius: var(--radius);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  border: 1px solid transparent; cursor:pointer;
  text-align:center;
}
.btn-primary{ background: var(--navy); color: var(--white); }
.btn-primary:hover{ background: var(--navy-2); }
.btn-outline{ border-color: var(--line); color: var(--ink); background:transparent; }
.btn-outline:hover{ border-color: var(--navy); }
.btn-accent{ background: var(--amber-deep); color: var(--white); }
.btn-accent:hover{ background:#A8450C; }

/* ============================================
   NODE DIAGRAM STRIP (under hero)
   Rebuilt as real HTML so the labels stay legible at every width -
   the old inline SVG scaled its 11px type down to ~3px on phones.
   ============================================ */
.node-strip{ position:relative; z-index:2; margin-top: 60px; }
.node-list{
  display:flex; align-items:flex-start;
  position:relative; gap: 4px;
}
.node-list li{
  position:relative;
  display:flex; flex-direction:column; align-items:center; gap:12px;
  flex: 1 1 0; min-width:0;
}
/* Connector drawn per item: starts at this dot's centre and spans exactly one
   cell, so it lands on the next dot's centre whatever the item count. */
.node-list li:not(:last-child)::after{
  content:""; position:absolute; top:5px;
  inset-inline-start:50%; width:100%; height:1px;
  background: var(--line);
}
.node-dot{
  position:relative; z-index:1;
  width:11px; height:11px; border-radius:50%;
  background: var(--paper); border:1.6px solid var(--teal);
  flex: 0 0 auto;
}
.node-code{
  position:relative; z-index:1;
  font-family: var(--font-mono); font-size: 11px; letter-spacing:.06em;
  color: var(--muted); white-space:nowrap;
}
a.node-code:hover{ color: var(--teal-dim); }
@media(max-width:520px){
  .node-strip{ margin-top: 44px; }
  .node-code{ font-size: 10px; letter-spacing:.02em; }
}

/* ============================================
   MODULE / SERVICE CARDS (signature element)
   ============================================ */
.section{ padding: 88px 0; }
.section-head{ max-width: 640px; margin-bottom: 48px; }
.section-head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--navy); }
.section-alt{ background: var(--paper-2); }

/* A page-header immediately followed by a .section produced ~128px of dead
   space - tighten the first section after an interior page header. */
.page-header + .section{ padding-top: 56px; }

/* Explicit fr columns per breakpoint - no px minimum, so a track can never be
   wider than its container (which is what caused the old horizontal overflow). */
.module-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media(min-width:640px){
  .module-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media(min-width:1080px){
  .module-grid{ grid-template-columns: repeat(3, 1fr); }
}

/* The seven-module home grid runs four across and lets its final card fill the
   rest of the row, so there are no empty slots.
   `:last-child:nth-child(7)` matches only when there are exactly seven cards,
   so the rule switches itself off if the modules array ever changes length. */
@media(min-width:640px){
  .module-grid-7 > :last-child:nth-child(7){ grid-column: span 2; }
}
@media(min-width:1080px){
  .module-grid-7{ grid-template-columns: repeat(4, 1fr); }
}
.module-card{
  position:relative;
  background: var(--white);
  border: 1px solid var(--line-soft);
  padding: 30px 26px 26px;
  transition: border-color .15s ease, transform .15s ease;
  min-width:0;
}
.module-card:hover{ border-color: var(--teal); transform: translateY(-2px); }
/* blueprint corner brackets: ::before = top-left, ::after = bottom-left,
   .bracket-tr = top-right, .bracket-br = bottom-right */
.module-card::before, .module-card::after,
.module-card .bracket-tr, .module-card .bracket-br{
  content:""; position:absolute; width:10px; height:10px;
  border-color: var(--line); border-style: solid; border-width:0;
}
.module-card::before{ top:-1px; left:-1px; border-top-width:2px; border-left-width:2px; }
.module-card .bracket-tr{ top:-1px; right:-1px; border-top-width:2px; border-right-width:2px; }
.module-card::after{ bottom:-1px; left:-1px; border-bottom-width:2px; border-left-width:2px; }
.module-card .bracket-br{ bottom:-1px; right:-1px; border-bottom-width:2px; border-right-width:2px; }
.module-card:hover::before, .module-card:hover::after,
.module-card:hover .bracket-tr, .module-card:hover .bracket-br{ border-color: var(--teal); }

.module-code{
  font-family: var(--font-mono); font-size: 12px; color: var(--teal-dim);
  letter-spacing:.08em; margin-bottom: 14px; display:block;
}
.module-card h3{ font-size: 18px; color: var(--navy); margin-bottom:.4em; overflow-wrap:break-word; }
.module-card h3 a{ color: inherit; }
.module-card h3 a:hover{ color: var(--teal-dim); text-decoration: underline; text-underline-offset:3px; }
.module-card p{ font-size: 14.5px; margin-bottom:0; }
.module-card .post-thumbnail{ margin: -30px -26px 20px; }
/* the single-post rule adds a border; inside a card that doubles the card edge */
.module-card .post-thumbnail img{ width:100%; border:none; }

/* ============================================
   WHY STRIP
   Rules are drawn with grid gap + a background colour so they stay aligned
   however many columns the grid wraps to.
   ============================================ */
.why-list{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.why-item{
  padding: 26px 24px;
  background: var(--paper);
}
.section-alt .why-item{ background: var(--paper-2); }
.why-item .num{ font-family: var(--font-mono); font-size:12px; color: var(--teal-dim); display:block; margin-bottom:8px; }
.why-item p{ color: var(--ink); font-size: 14.5px; margin:0; }

/* ============================================
   CTA BAND
   ============================================ */
.cta-band{
  background: var(--navy); color: var(--white);
  padding: 64px 0; text-align:center;
}
.cta-band h2{ color: var(--white); font-size: clamp(1.6rem,3vw,2.2rem); margin-bottom:.3em; }
.cta-band p{ color: #C6D0DE; max-width:520px; margin:0 auto 28px; }

/* ============================================
   PAGE HEADER (interior pages)
   ============================================ */
.page-header{ padding: 64px 0 40px; border-bottom: 1px solid var(--line-soft); }
.page-header h1{ font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--navy); overflow-wrap:break-word; }
.page-header p{ max-width: 620px; font-size:16px; margin-bottom:0; }

/* ============================================
   SERVICES (detail list on Services page)
   ============================================ */
.service-detail{
  display:grid; grid-template-columns: 240px 1fr; gap: 40px;
  padding: 40px 0; border-bottom: 1px solid var(--line-soft);
}
.service-detail:first-of-type{ border-top: 1px solid var(--line-soft); }
.service-detail .label{ font-family: var(--font-mono); min-width:0; }
.service-detail .label .code{ display:block; color: var(--teal-dim); font-size:12px; margin-bottom:10px; letter-spacing:.08em; }
.service-detail .label h3{ font-size: 19px; color: var(--navy); font-family: var(--font-display); overflow-wrap:break-word; }
.service-detail .body{ min-width:0; }
.service-detail .body p{ margin-bottom: 10px; }
.service-detail .tags{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.service-detail .tags span{
  font-family: var(--font-mono); font-size:11.5px; color: var(--navy);
  border:1px solid var(--line); padding:4px 10px; border-radius: 20px;
}
@media(max-width:860px){ .service-detail{ grid-template-columns: 1fr; gap:12px; } }

/* ============================================
   ABOUT / GENERIC PROSE WRAPPER
   ============================================ */
/* Nested inside .container (not combined with it), so the prose column shares
   a left edge with the page-header heading instead of being centred. */
.about-block{ max-width: 760px; }
.about-block > p{ font-size: 16px; }
.placeholder-note{
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  border: 1px dashed var(--line); padding: 14px 18px; margin-top: 20px;
}

/* ============================================
   EDITOR CONTENT (the_content) - restores everything the
   chrome-focused resets take away, plus core WP classes.
   ============================================ */
.entry-content > *:first-child{ margin-top:0; }
.entry-content > *:last-child{ margin-bottom:0; }
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6{ color: var(--navy); margin-top: 1.8em; }
.entry-content h2{ font-size: 1.6rem; }
.entry-content h3{ font-size: 1.28rem; }
.entry-content h4{ font-size: 1.1rem; }
.entry-content h5{ font-size: 1rem; }
.entry-content h6{ font-size: .9rem; text-transform:uppercase; letter-spacing:.06em; font-family: var(--font-mono); }

/* Links must be visible in prose - the global `a` rule strips colour+underline */
.entry-content a,
.comment-content a{
  color: var(--teal-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.entry-content a:hover,
.comment-content a:hover{ color: var(--navy); }

/* Lists - the global reset is scoped to chrome, but be explicit here */
.entry-content ul,
.entry-content ol,
.comment-content ul,
.comment-content ol{
  margin: 0 0 1em; padding-inline-start: 1.4em; color: var(--muted);
}
.entry-content ul{ list-style: disc; }
.entry-content ol{ list-style: decimal; }
.entry-content li{ margin-bottom: .4em; }
.entry-content li > ul,
.entry-content li > ol{ margin-top: .4em; margin-bottom: 0; }

.entry-content blockquote{
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-inline-start: 2px solid var(--teal);
}
.entry-content blockquote p{ font-size: 17px; color: var(--ink); }
.entry-content blockquote cite{
  font-family: var(--font-mono); font-size:12.5px; color: var(--muted); font-style:normal;
}

.entry-content code,
.entry-content kbd,
.entry-content samp{
  font-family: var(--font-mono); font-size: .9em;
  background: var(--paper-2); border:1px solid var(--line-soft);
  padding: 1px 5px; border-radius: var(--radius);
}
.entry-content pre{
  font-family: var(--font-mono); font-size: 13px; line-height:1.6;
  background: var(--ink); color: #D5DCE6;
  padding: 18px 20px; border-radius: var(--radius);
  overflow-x: auto; margin: 1.6em 0;
}
.entry-content pre code{
  background:none; border:none; padding:0; color:inherit; font-size:inherit;
}

/* Tables must be able to scroll rather than widen the page */
.entry-content table,
.entry-content .wp-block-table table{
  width:100%; border-collapse:collapse; margin: 1.6em 0; font-size: 14.5px;
}
.entry-content .wp-block-table,
.entry-content figure.wp-block-table{ overflow-x:auto; }
.entry-content th,
.entry-content td{
  border:1px solid var(--line-soft); padding: 10px 14px; text-align:start;
}
.entry-content th{
  background: var(--paper-2); font-family: var(--font-mono);
  font-size:12px; letter-spacing:.06em; text-transform:uppercase; color: var(--navy);
}

.entry-content hr,
.entry-content .wp-block-separator{
  border:none; border-top:1px solid var(--line-soft); margin: 2.4em 0; height:0;
}
.entry-content figure{ margin: 1.8em 0; }
.entry-content figcaption,
.entry-content .wp-caption-text,
.entry-content .gallery-caption{
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  margin-top: 8px; text-align:start;
}
.entry-content dl{ margin: 0 0 1em; }
.entry-content dt{ font-weight:600; color: var(--ink); }
.entry-content dd{ margin: 0 0 .8em; padding-inline-start: 1.2em; color: var(--muted); }

/* Core alignment classes */
.alignleft{ float:left; margin: .3em 1.6em 1.2em 0; }
.alignright{ float:right; margin: .3em 0 1.2em 1.6em; }
.aligncenter{ margin-inline:auto; display:block; }
.entry-content .aligncenter{ text-align:center; }
.alignnone{ margin: 1.2em 0; }
.entry-content .alignwide{
  width: 100%;
  max-width: min(1080px, calc(100vw - (var(--gutter) * 2)));
  margin-inline: auto;
}
.entry-content .alignfull{
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
}
.wp-caption{ max-width:100%; }
.wp-caption img{ margin-inline:auto; }
.wp-block-image img{ margin-inline:auto; }
.wp-block-button__link{
  display:inline-flex; align-items:center;
  font-family: var(--font-mono); font-size:13.5px; font-weight:500;
  background: var(--navy); color: var(--white);
  padding: 13px 26px; border-radius: var(--radius); text-decoration:none;
}
.wp-block-button__link:hover{ background: var(--navy-2); color: var(--white); }
.sticky .module-code::after{ content:" · Pinned"; }
.gallery{ display:flex; flex-wrap:wrap; gap: 12px; margin: 1.8em 0; }
.gallery-item{ flex: 1 1 160px; }

/* Post/page splitting + comment reply-cancel */
.page-links{
  font-family: var(--font-mono); font-size:13px; margin-top: 2em;
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
}
.page-links a{ border:1px solid var(--line); padding:4px 10px; }
.page-links a:hover{ border-color: var(--navy); }

/* ============================================
   ARCHIVE PAGINATION
   ============================================ */
.pagination,
.posts-navigation,
.post-navigation{ margin-top: 48px; }
.nav-links{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  font-family: var(--font-mono); font-size:13px;
}
.page-numbers{
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
a.page-numbers:hover{ border-color: var(--navy); }
.page-numbers.current{ background: var(--navy); border-color: var(--navy); color: var(--white); }
.page-numbers.dots{ border-color:transparent; min-width:auto; padding:0 4px; }
.post-navigation .nav-links{ justify-content:space-between; gap: 20px; }
.post-navigation a{ color: var(--navy); }
.post-navigation a:hover{ text-decoration:underline; text-underline-offset:3px; }

/* ============================================
   SINGLE POST EXTRAS
   ============================================ */
.post-thumbnail{ margin-bottom: 32px; }
.post-thumbnail img{ width:100%; border:1px solid var(--line-soft); }
.entry-meta{
  font-family: var(--font-mono); font-size:12px; color: var(--muted);
  letter-spacing:.06em; margin-top: 24px;
  display:flex; flex-wrap:wrap; gap: 6px 18px;
}
.entry-meta a{ color: var(--teal-dim); }
.entry-meta a:hover{ text-decoration:underline; text-underline-offset:3px; }

/* ============================================
   COMMENTS
   ============================================ */
.comments-area{ max-width: 760px; margin-top: 64px; padding-top: 40px; border-top:1px solid var(--line-soft); }
.comments-title,
.comment-reply-title{ font-size: 1.2rem; color: var(--navy); }
.comment-list{ margin-bottom: 40px; }
.comment-list li{ margin-bottom: 24px; }
.comment-list .children{ list-style:none; margin: 24px 0 0; padding-inline-start: 24px; border-inline-start:1px solid var(--line-soft); }
.comment-body{ background: var(--white); border:1px solid var(--line-soft); padding: 20px 22px; }
.comment-author{ font-family: var(--font-display); font-weight:600; font-size:15px; color: var(--navy); display:flex; align-items:center; gap:10px; }
.comment-author img{ border-radius:50%; }
.comment-metadata{ font-family: var(--font-mono); font-size:11.5px; color: var(--muted); margin: 4px 0 12px; }
.comment-content p:last-child{ margin-bottom:0; }
.reply{ font-family: var(--font-mono); font-size:12px; margin-top: 10px; }
.reply a{ color: var(--teal-dim); }
.comment-form{ display:grid; gap:16px; }
.comment-form label{ font-family: var(--font-mono); font-size:12px; color: var(--muted); letter-spacing:.06em; display:block; margin-bottom:6px; }
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea{
  width:100%; border:1px solid var(--line); background: var(--white);
  padding: 12px 14px; font-family: var(--font-body); font-size:14px; border-radius: var(--radius);
}
.comment-form textarea{ min-height: 130px; resize:vertical; }
.comment-form .form-submit input[type="submit"]{
  font-family: var(--font-mono); font-size:13.5px; font-weight:500;
  background: var(--navy); color: var(--white);
  border:1px solid var(--navy); padding: 13px 26px;
  border-radius: var(--radius); cursor:pointer;
}
.comment-form .form-submit input[type="submit"]:hover{ background: var(--navy-2); }
.comment-notes,
.comment-form-cookies-consent{ font-size:13px; }
.no-comments{ font-family: var(--font-mono); font-size:13px; color: var(--muted); }

/* ============================================
   CONTACT
   ============================================ */
.contact-wrap{ display:grid; grid-template-columns: 1fr 1fr; gap: 60px; }
@media(max-width:880px){ .contact-wrap{ grid-template-columns:1fr; gap: 44px; } }
.contact-info{ min-width:0; }
.contact-info .item{ margin-bottom: 22px; }
.contact-info .item .k{
  font-family: var(--font-mono); font-size:12px; color: var(--teal-dim);
  letter-spacing:.08em; text-transform:uppercase;
  display:block; margin-bottom:6px;
}
.contact-info .item .v{ font-size: 15px; color: var(--ink); overflow-wrap:break-word; }
.contact-info .item a.v:hover{ color: var(--teal-dim); text-decoration:underline; text-underline-offset:3px; }
.contact-form-wrap{ min-width:0; }

.wpcf7-form, .contact-form{ display:flex; flex-direction:column; gap:16px; }
.contact-form label{ font-family: var(--font-mono); font-size:12px; color: var(--muted); letter-spacing:.06em; display:block; margin-bottom:6px; }
.contact-form .required{ color: var(--amber-deep); }
.contact-form input, .contact-form textarea{
  width:100%; border: 1px solid var(--line); background: var(--white);
  padding: 12px 14px; font-family: var(--font-body); font-size:14px; border-radius: var(--radius);
  color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus{ border-color: var(--teal-dim); outline:none; }
.contact-form input[aria-invalid="true"], .contact-form textarea[aria-invalid="true"]{ border-color: var(--amber-deep); }
.contact-form textarea{ min-height: 130px; resize:vertical; }
.contact-form button{ align-self:flex-start; }
.form-note{
  font-family: var(--font-mono); font-size:11.5px; color: var(--muted); margin-top:14px;
}
.form-message{
  font-family: var(--font-mono); font-size:13px;
  padding: 14px 18px; margin-bottom: 22px; border-radius: var(--radius);
}
.form-message.is-success{ background:#E6F4F2; border:1px solid var(--teal); color: var(--teal-dim); }
.form-message.is-error{ background:#FBEDE5; border:1px solid var(--amber-deep); color: var(--amber-deep); }

/* Honeypot - must be hidden without display:none so bots still fill it */
.hp-field{
  position:absolute !important; width:1px; height:1px;
  overflow:hidden; clip-path: inset(50%); white-space:nowrap;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form{ display:flex; gap:10px; max-width: 480px; flex-wrap:wrap; }
.search-form .search-field{
  flex: 1 1 220px; min-width:0;
  border:1px solid var(--line); background: var(--white);
  padding: 12px 14px; font-family: var(--font-body); font-size:14px;
  border-radius: var(--radius); color: var(--ink);
}
.search-form .search-field:focus{ border-color: var(--teal-dim); outline:none; }

/* ============================================
   404
   ============================================ */
.error-404{ max-width: 620px; }
.error-code{
  font-family: var(--font-mono); font-size: clamp(3rem, 12vw, 6rem);
  color: var(--line); line-height:1; margin-bottom: 12px; display:block;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer{ background: var(--ink); color: var(--footer-text); padding: 64px 0 28px; }

/* Both footer rows share ONE column template so their columns line up
   vertically. They previously used different templates (1.4fr 1fr 1fr vs
   auto-fit), which put columns 2 and 3 out of line by 85px and 46px. */
.footer-widgets,
.footer-grid{
  display:grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}
.footer-grid{ margin-bottom: 40px; }
@media(max-width:760px){
  .footer-widgets,
  .footer-grid{ grid-template-columns:1fr; gap: 32px; }
}
.footer-grid h4{ color: var(--white); font-size: 13px; font-family: var(--font-mono); letter-spacing:.08em; margin-bottom: 16px; text-transform:uppercase; }
/* block, not flex, so the space before "/ME" survives */
.footer-brand{
  font-family: var(--font-display); font-weight:700; font-size:19px;
  color: var(--white); margin-bottom: 12px;
}
.footer-brand .bracket{
  color: var(--teal);
  font-family: var(--font-mono);
  font-weight:400;
}
.footer-grid p{ color: var(--footer-dim); font-size: 14px; }
.footer-grid ul li{ margin-bottom: 10px; }
.footer-grid ul a{ color: var(--footer-text); font-size:14px; }
.footer-grid ul a:hover{ color: var(--teal); text-decoration:underline; text-underline-offset:3px; }
/* Separated from the footer columns below by a rule, so the two rows read as
   distinct blocks rather than one ragged mass. */
.footer-widgets{
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid #262E3A;
}
/* Classic widgets emit the `before_title` <h4>; block widgets (the WordPress
   default since 5.8) emit <h2 class="wp-block-heading"> and ignore it - so
   style every heading level the same way here. */
.footer-widgets h2,
.footer-widgets h3,
.footer-widgets h4,
.footer-widgets .wp-block-heading{
  color: var(--white); font-size:13px; font-family: var(--font-mono);
  letter-spacing:.08em; text-transform:uppercase; margin-bottom:16px;
  line-height:1.4; font-weight:500;
}
.footer-widgets a{ color: var(--footer-text); }
.footer-widgets a:hover{ color: var(--teal); }
.footer-widgets ul{ list-style:none; margin:0; padding:0; }
.footer-widgets li{ margin-bottom: 10px; font-size:14px; }
.footer-bottom{
  border-top: 1px solid #262E3A; padding-top:22px;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--footer-dim);
}

/* ============================================
   UTIL
   ============================================ */
.text-center{ text-align:center; }
.actions-start{ justify-content:flex-start; margin-top:32px; }
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
  html{ scroll-behavior:auto; }
}

/* ============================================
   RTL - the layout uses logical properties throughout; these are the
   few directional leftovers (corner brackets, nav underline origin).
   ============================================ */
[dir="rtl"] .main-nav a::after{ transform-origin: right; }
[dir="rtl"] .alignleft{ float:right; margin: .3em 0 1.2em 1.6em; }
[dir="rtl"] .alignright{ float:left; margin: .3em 1.6em 1.2em 0; }
