/*
Theme Name: Callum MLNY
Theme URI: https://callum.mlny.me
Author: Callum Malaney
Author URI: https://callum.mlny.me
Description: Personal blog theme for callum.mlny.me — marketing, strategy, and consulting essays.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: callum-mlny
Tags: blog, minimal, personal
*/

:root {
  --ink: #1a1916;
  --warm-white: #f7f5f0;
  --mid: #8a8782;
  --rule: #e0ddd8;
  --accent: #FFF500;
  --accent-dark: #F2AF0D;
  --blue-start: #0DCAF2;
  --blue-end: #4D59B3;
  --grad-yellow: linear-gradient(135deg, #FFF500 0%, #F2AF0D 100%);
  --grad-blue: linear-gradient(135deg, #0DCAF2 0%, #4D59B3 100%);
  --serif: 'Solway', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--warm-white);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── ACCESSIBILITY ── */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--warm-white);
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus { top: 1rem; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 3rem;
  background: var(--warm-white);
  border-bottom: 1px solid var(--rule);
  animation: fadeDown 0.6s ease both;
}

/* Custom logo (uploaded via Customizer) */
.custom-logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.custom-logo-link img,
.custom-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* Text fallback when no logo is uploaded */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex; gap: 2rem; list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current-menu-ancestor > a { color: var(--ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── HERO ── */
.hero {
  padding: 9rem 3rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeUp 0.8s 0.2s ease both;
}

.hero-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 3px;
  background: var(--grad-blue);
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--warm-white);
  background: linear-gradient(135deg, #0DCAF2 0%, #4D59B3 100%);
  padding: 0 0.15em 0 0;
}

.hero-sub {
  font-size: 1rem;
  color: var(--mid);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.hero-cta svg { transition: transform 0.2s; }
.hero-cta:hover {
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-color: #0DCAF2;
}
.hero-cta:hover svg { transform: translateX(3px); stroke: #4D59B3; }

/* ── FEATURED ── */
.featured {
  max-width: 100%;
  background: #f0ede7;
  padding: 4rem 0;
}

.featured-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
  animation: fadeUp 0.8s 0.4s ease both;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 2.5rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.featured-primary {
  padding-right: 3rem;
  border-right: 1px solid var(--rule);
}

.featured-primary .post-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.9rem;
  display: inline-block;
  text-decoration: none;
}

.featured-primary h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.featured-primary h2 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.featured-primary h2 a:hover { opacity: 0.7; }

.featured-primary > p {
  color: var(--mid);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.post-meta {
  font-size: 0.75rem;
  color: var(--mid);
  letter-spacing: 0.04em;
  display: flex; gap: 1rem; align-items: center;
}
.post-meta-dot { color: var(--rule); }

.featured-secondary {
  padding-left: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mini-post {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.mini-post:last-child { border-bottom: none; padding-bottom: 0; }

.mini-post .post-tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.5rem;
  display: inline-block;
  text-decoration: none;
}

.mini-post h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.mini-post h3 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.mini-post h3 a:hover { opacity: 0.7; }

.mini-post .post-meta { margin-top: 0.5rem; }

/* ── PAGE FOOTER WRAPPER ── */
.page-footer {
  background: #f0ede7;
}

/* ── NEWSLETTER ── */
.newsletter {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 3rem 0;
}

.newsletter-box {
  background: var(--warm-white);
  position: relative;
  padding: 2.5rem 2.5rem 2.5rem 3.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  border: 1px solid var(--rule);
}
.newsletter-box::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  background: var(--grad-blue);
}

.newsletter-box h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.newsletter-box p {
  font-size: 0.88rem;
  color: var(--mid);
}

.newsletter-form {
  display: flex;
  gap: 0;
  min-width: 320px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--warm-white);
  border: 1px solid var(--rule);
  border-right: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
  outline: none;
}
.newsletter-form input[type="email"]::placeholder { color: var(--mid); }
.newsletter-form input[type="email"]:focus { border-color: var(--mid); }

.newsletter-form button {
  padding: 0.8rem 1.5rem;
  background: var(--ink);
  color: var(--warm-white);
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.newsletter-form button:hover { background: var(--grad-blue); border-color: #0DCAF2; }

/* ── BREVO FORM OVERRIDES ── */

/* Reset form container */
.sib_signup_form,
.sib_signup_box_inside_2 {
  padding: 0 !important;
  background: transparent !important;
  font-family: var(--sans) !important;
}

/* Field wrapper paragraphs */
.sib_signup_form p {
  margin: 0 0 0.75rem 0 !important;
  padding: 0 !important;
  font-family: var(--sans) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--mid) !important;
}

/* Last paragraph (submit button) no bottom margin */
.sib_signup_form p:last-child {
  margin-bottom: 0 !important;
}

/* Name fields side by side */
.sib_signup_form p.sib-FIRSTNAME-area,
.sib_signup_form p.sib-LASTNAME-area {
  display: inline-block !important;
  width: calc(50% - 0.4rem) !important;
  vertical-align: top !important;
}

.sib_signup_form p.sib-FIRSTNAME-area {
  margin-right: 0.5rem !important;
}

/* Email full width */
.sib_signup_form p.sib-email-area {
  display: block !important;
  width: 100% !important;
}

/* All inputs */
.sib_signup_form input[type="text"],
.sib_signup_form input[type="email"] {
  display: block !important;
  width: 100% !important;
  margin-top: 0.35rem !important;
  padding: 0.8rem 1rem !important;
  background: var(--warm-white) !important;
  background-image: none !important;
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  font-family: var(--sans) !important;
  font-size: 0.85rem !important;
  color: var(--ink) !important;
  outline: none !important;
  box-shadow: none !important;
  height: auto !important;
  -webkit-appearance: none !important;
}

.sib_signup_form input[type="text"]:focus,
.sib_signup_form input[type="email"]:focus {
  border-color: #0DCAF2 !important;
}

.sib_signup_form input::placeholder {
  color: var(--mid) !important;
}

/* Hide Brevo's "Generate new mask" accessibility button visually */
.sib_signup_form button[type="button"] {
  display: none !important;
}

/* Submit button */
.sib_signup_form input[type="submit"].sib-default-btn {
  display: block !important;
  width: 100% !important;
  padding: 0.8rem 1.5rem !important;
  background: var(--ink) !important;
  color: var(--warm-white) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  font-family: var(--sans) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
}

.sib_signup_form input[type="submit"].sib-default-btn:hover {
  background: linear-gradient(135deg, #0DCAF2 0%, #4D59B3 100%) !important;
  border-color: #0DCAF2 !important;
}

/* Success/error messages */
.sib_signup_form .sib_msg_disp {
  font-family: var(--sans) !important;
  font-size: 0.82rem !important;
  margin-bottom: 0.75rem !important;
}

@media (max-width: 768px) {
  .sib_signup_form p.sib-FIRSTNAME-area,
  .sib_signup_form p.sib-LASTNAME-area {
    display: block !important;
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* ── ABOUT STRIP ── */
.about-strip {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 3rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.about-text {
  font-size: 0.88rem;
  color: var(--mid);
  line-height: 1.6;
}
.about-text strong { color: var(--ink); font-weight: 500; }
.about-text a {
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer p {
  font-size: 0.75rem;
  color: var(--mid);
}

.footer-links {
  display: flex; gap: 1.5rem; list-style: none;
}
.footer-links a {
  font-size: 0.75rem;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--ink); }

/* ── ARCHIVE / BLOG INDEX ── */
.archive-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 3rem 5rem;
}

.archive-header {
  margin-bottom: 2.5rem;
}

.post-list { list-style: none; }

.post-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: opacity 0.2s;
}
.post-row:hover { opacity: 0.7; }
.post-row:first-child { border-top: 1px solid var(--rule); }

.post-row-date {
  font-size: 0.75rem;
  color: var(--mid);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.post-row-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
}

.post-row-title a {
  color: inherit;
  text-decoration: none;
}
.post-row-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.post-row-tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  white-space: nowrap;
}

/* Pagination */
.posts-pagination {
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
}

.posts-pagination .page-numbers {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.posts-pagination .page-numbers:hover { color: var(--ink); }
.posts-pagination .page-numbers.current { color: var(--ink); font-weight: 500; }

.no-posts {
  font-size: 0.95rem;
  color: var(--mid);
  padding: 2rem 0;
}

/* ── SINGLE POST ── */
.single-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 3rem 5rem;
}

.single-article {
  max-width: 720px;
}

.single-post-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  display: inline-block;
  text-decoration: none;
}

.single-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.single-meta {
  font-size: 0.75rem;
  color: var(--mid);
  letter-spacing: 0.04em;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

/* Entry content typography */
.entry-content {
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 300;
}

.entry-content p { margin-bottom: 1.5rem; }

.entry-content h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
}

.entry-content h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

.entry-content h4 {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.5rem 0 0.75rem;
}

.entry-content a {
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: underline;
  text-decoration-color: var(--blue-start);
}

.entry-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--blue-start);
  background: #f0ede7;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
}
.entry-content blockquote p { margin-bottom: 0; }

.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.entry-content li { margin-bottom: 0.5rem; }

.entry-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}

.entry-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.entry-content pre {
  background: #f0ede7;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.entry-content code {
  font-size: 0.9em;
  background: #f0ede7;
  padding: 0.15em 0.4em;
}

.entry-content pre code {
  background: none;
  padding: 0;
}

/* WordPress alignment classes */
.alignleft { float: left; margin: 0.5rem 2rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 2rem; }
.aligncenter { display: block; margin: 1.5rem auto; text-align: center; }
.alignwide { max-width: 900px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }

/* Post navigation */
.post-navigation {
  max-width: 720px;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.post-navigation a {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}
.post-navigation a:hover { color: var(--ink); }

/* ── PAGE ── */
.page-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 3rem 5rem;
}

.page-article {
  max-width: 720px;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

/* ── ANIMATIONS ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0 1rem;
    border-top: 1px solid var(--rule);
    margin-top: 0.75rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 0.65rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--rule);
  }
  .nav-links li:last-child a { border-bottom: none; }

  .hero, .featured-inner, .newsletter, .about-strip, footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-primary { padding-right: 0; border-right: none; border-bottom: 1px solid var(--rule); padding-bottom: 2rem; margin-bottom: 2rem; }
  .featured-secondary { padding-left: 0; }
  .newsletter-box {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem 2rem 2.5rem;
  }
  .newsletter-form {
    min-width: auto;
    flex-direction: column;
    gap: 0.75rem;
  }
  .newsletter-form input[type="email"] {
    border-right: 1px solid var(--rule);
    width: 100%;
  }
  .newsletter-form button { width: 100%; }
  .post-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .post-row-date { display: none; }
  .single-main, .page-main, .archive-main { padding: 6rem 1.5rem 4rem; }
  .post-navigation { flex-direction: column; gap: 1rem; }
  footer { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
