/* =========================================================
   Andi Shehu — shared styles
   ========================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

:root {
    /* Marginalian-inspired cream + brick + ochre palette */
    --bg:          #FAF6F0;
    --bg-about:    #F5EFE3;
    --bg-blog:     #F8F2E6;
    --bg-services: #F4ECDB;
    --bg-reading:  #FBF6E8;
    --bg-contact:  #F3EEE2;
    --surface:     #FFFFFF;
    --surface-alt: #F0E9DA;
    --primary:     #9C3D2E;
    --primary-light:#C77567;
    --primary-dark: #7B2E22;
    --secondary:   #7A8B6E;
    --accent:      #C8932E;
    --accent-warm: #EDD9A8;
    --gold:        #C8932E;
    --text:        #1A1614;
    --text-muted:  #5C5147;
    --border:      #E5DDD0;
    --shadow-sm:   0 2px 8px rgba(60,40,30,0.07);
    --shadow-md:   0 6px 22px rgba(60,40,30,0.10);
    --shadow-lg:   0 12px 44px rgba(60,40,30,0.14);
    --radius:      14px;
    --radius-sm:   8px;
    --radius-full: 9999px;
    --transition:  0.3s cubic-bezier(0.4,0,0.2,1);
    --nav-height:  68px;
}
[data-theme="dark"] {
    --bg:          #1A1614;
    --bg-about:    #1F1916;
    --bg-blog:     #1C1815;
    --bg-services: #201813;
    --bg-reading:  #1F1B14;
    --bg-contact:  #1B1714;
    --surface:     #261F1B;
    --surface-alt: #2E2620;
    --primary:     #D27767;
    --primary-light:#E89D8E;
    --primary-dark: #B85040;
    --secondary:   #98A98C;
    --accent:      #DEB87A;
    --accent-warm: #4A3A22;
    --gold:        #DEB87A;
    --text:        #F4F0E8;
    --text-muted:  #B0A89A;
    --border:      #3D362F;
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.30);
    --shadow-md:   0 4px 20px rgba(0,0,0,0.40);
    --shadow-lg:   0 8px 40px rgba(0,0,0,0.50);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
    /* Subtle paper-like grain on cream backgrounds */
    background-image:
        radial-gradient(circle at 25% 30%, rgba(156,61,46,0.012) 0, transparent 40%),
        radial-gradient(circle at 75% 70%, rgba(200,147,46,0.012) 0, transparent 40%);
}
h1,h2,h3,h4 {
    font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
    font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 0;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); }
p  { color: var(--text-muted); line-height: 1.85; }
a  { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Editorial link style: subtle underline that flows below the descender */
.article-body a, .hero-desc a, .page-intro a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(156,61,46,0.35);
    transition: text-decoration-color 0.2s, color 0.2s;
}
.article-body a:hover, .hero-desc a:hover, .page-intro a:hover {
    color: var(--primary-dark);
    text-decoration-color: var(--primary);
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 2rem; width: 100%; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 2rem; width: 100%; }
.section { padding: 96px 0; }
.section-sm { padding: 60px 0; }

.divider {
    position: relative; height: 60px;
    display: flex; align-items: center; justify-content: center;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.divider::after { margin-left: 1.5rem; }
.divider::before { margin-right: 1.5rem; }
.divider-mark {
    width: 12px; height: 12px; transform: rotate(45deg);
    background: var(--accent); flex-shrink: 0;
}
/* Default ornament when no inner mark is provided */
.divider::after, .divider::before { background: var(--border); }

.section-label {
    display: inline-block;
    font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
    font-variation-settings: 'opsz' 18;
    font-style: italic;
    font-size: 0.95rem; font-weight: 500;
    letter-spacing: 0.02em; text-transform: none;
    color: var(--primary); background: transparent;
    padding: 0; margin-bottom: 1.2rem; opacity: 1;
    border-bottom: 1px solid var(--primary-light);
    padding-bottom: 0.15rem;
}
[data-theme="dark"] .section-label { color: var(--primary); border-bottom-color: var(--primary-dark); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.85rem 1.9rem; border-radius: var(--radius-full);
    font-weight: 500; font-size: 0.95rem; cursor: pointer;
    border: none; transition: all var(--transition);
    position: relative; overflow: hidden;
    font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 18px rgba(124,111,175,0.38); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,111,175,0.48); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-accent  { background: var(--accent); color: #fff; box-shadow: 0 4px 18px rgba(232,144,123,0.38); }
.btn-accent:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,144,123,0.48); }
.btn-white {
    background: white; color: #E05800; padding: 0.82rem 1.9rem;
    border-radius: var(--radius-full); font-weight: 600; font-size: 0.95rem;
    transition: all 0.25s; white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.22); }

.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: ripple-anim 0.65s linear; background: rgba(255,255,255,0.32); pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4.5); opacity: 0; } }

.fade-in { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---------- NAV ---------- */
nav.site-nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height); z-index: 1000;
    display: flex; align-items: center; transition: all var(--transition);
}
nav.site-nav.scrolled,
nav.site-nav.solid { background: var(--surface); box-shadow: var(--shadow-md); }
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 2rem;
}
.nav-logo { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; user-select: none; }
.nav-logo-mark {
    width: 38px; height: 38px; border-radius: 9px;
    overflow: hidden; flex-shrink: 0;
    transition: transform 0.35s;
}
.nav-logo-mark svg { width: 100%; height: 100%; display: block; }
.nav-logo-mark .logo-bg     { fill: var(--primary); transition: fill 0.35s; }
.nav-logo-mark .logo-tower  { fill: #FAF6F0; }
.nav-logo-mark .logo-beacon { fill: var(--gold); transition: fill 0.35s, transform 0.4s; transform-origin: 32px 15px; }
.nav-logo:hover .nav-logo-mark .logo-bg { fill: var(--primary-dark); }
.nav-logo:hover .nav-logo-mark .logo-beacon { fill: #F5E5B0; transform: scale(1.25); }
.nav-logo:hover .nav-logo-mark { transform: rotate(-3deg); }
.nav-logo-mark { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav-logo-text { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 600; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 0.1rem; list-style: none; }
.nav-links a {
    font-size: 0.86rem; font-weight: 500; color: var(--text-muted);
    padding: 0.45rem 0.95rem; border-radius: var(--radius-full); transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--surface-alt); }
.nav-actions { display: flex; align-items: center; gap: 0.85rem; }

.theme-toggle {
    width: 46px; height: 25px; background: var(--border);
    border-radius: var(--radius-full); border: none; cursor: pointer;
    position: relative; transition: background var(--transition);
}
.theme-toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 19px; height: 19px; background: var(--surface); border-radius: 50%;
    transition: transform var(--transition); box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
[data-theme="dark"] .theme-toggle { background: var(--primary); }
[data-theme="dark"] .theme-toggle::after { transform: translateX(21px); }
.theme-icon { position: absolute; top: 50%; transform: translateY(-50%); font-size: 10px; transition: opacity var(--transition); }
.theme-icon.sun { left: 5px; opacity: 1; }
.theme-icon.moon { right: 4px; opacity: 0; }
[data-theme="dark"] .theme-icon.sun { opacity: 0; }
[data-theme="dark"] .theme-icon.moon { opacity: 1; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--surface); padding: 1.25rem 2rem;
    box-shadow: var(--shadow-lg); z-index: 999;
    flex-direction: column; gap: 0.25rem; border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-size: 1rem; font-weight: 500; color: var(--text); padding: 0.7rem 1rem; border-radius: var(--radius-sm); transition: all var(--transition); }
.mobile-nav a:hover { background: var(--surface-alt); color: var(--primary); }

/* Add top padding so content clears the fixed nav on subpages */
.has-nav-offset { padding-top: var(--nav-height); }

/* ---------- Page intro band (sub-pages) ---------- */
.page-intro {
    padding: 6rem 0 3rem; position: relative;
}
.page-intro h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 0.75rem;
}
.page-intro p { max-width: 620px; font-size: 1.05rem; }

/* ---------- Nav cards (home) ---------- */
.nav-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem; margin-top: 2rem;
}
.nav-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem 1.5rem;
    text-decoration: none; color: inherit; display: block;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.nav-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.nav-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--surface-alt); display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 1rem;
}
.nav-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; color: var(--text); }
.nav-card p  { font-size: 0.86rem; line-height: 1.55; }
.nav-card-arrow {
    position: absolute; top: 1.3rem; right: 1.3rem;
    color: var(--text-muted); font-size: 1.1rem; transition: all 0.25s;
}
.nav-card:hover .nav-card-arrow { color: var(--primary); transform: translate(3px,-3px); }

/* ---------- Article cards (compact, used on home + writing) ---------- */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 1.8rem; }
.article-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all var(--transition); display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
}
.article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); border-color: transparent; }
.article-card-img { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; }
.article-card-img.lav   { background: linear-gradient(135deg, #D4CAEE, var(--primary-light)); }
.article-card-img.mint  { background: linear-gradient(135deg, #B5EAD7, #C9F0E2); }
.article-card-img.peach { background: linear-gradient(135deg, #F5D8C0, #F2C2AE); }
.article-card-img.gold  { background: linear-gradient(135deg, #F5E5B0, #E8D480); }
.article-card-img.sky   { background: linear-gradient(135deg, #BFD9F2, #D6EAF8); }
.article-card-img.has-photo { padding: 0; overflow: hidden; }
.article-card-img.has-photo img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.5s ease;
}
.article-card:hover .article-card-img.has-photo img { transform: scale(1.05); }
.article-card-body  { padding: 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.article-card-tags  { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.article-tag {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--primary); background: var(--surface-alt); padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full); border: 1px solid var(--border);
}
.article-card h3 { font-size: 1.2rem; margin-bottom: 0.55rem; color: var(--text); transition: color var(--transition); }
.article-card:hover h3 { color: var(--primary); }
.article-card p  { font-size: 0.88rem; flex: 1; margin-bottom: 1.2rem; }
.article-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.article-date { font-size: 0.78rem; color: var(--text-muted); }
.article-readmore { font-size: 0.82rem; font-weight: 600; color: var(--primary); }
.no-results { grid-column: 1/-1; text-align: center; padding: 4rem; color: var(--text-muted); }
.no-results-emoji { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ---------- Newsletter / Substack banners ---------- */
.newsletter-banner {
    margin-top: 4rem; border-radius: var(--radius); padding: 3rem;
    text-align: center; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.newsletter-banner::before { content: '✦'; position: absolute; font-size: 12rem; opacity: 0.04; top: -3rem; right: -2rem; color: white; line-height: 1; }
.newsletter-banner h3 { font-size: 2rem; margin-bottom: 0.75rem; color: white; }
.newsletter-banner p  { color: rgba(255,255,255,0.82); margin-bottom: 2rem; }

/* ---------- FOOTER ---------- */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand > p { font-size: 0.88rem; margin: 1rem 0 1.5rem; }
.tgl-badge {
    display: inline-flex; align-items: center; gap: 0.7rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.7rem 1rem;
    text-decoration: none; color: var(--text); font-size: 0.83rem; font-weight: 500;
    transition: all var(--transition);
}
.tgl-badge:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tgl-logo { width: 30px; height: 30px; background: #1B4FFF; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: white; font-weight: 700; font-family: 'Cormorant Garamond', serif; }
.footer-col h4 { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 1.2rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.55rem; }
.footer-links a { font-size: 0.88rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.8rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-links-row { display: flex; gap: 1.5rem; align-items: center; }
.footer-links-row a { font-size: 0.8rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links-row a:hover { color: var(--primary); }
.easter-star { cursor: default; user-select: none; color: var(--text-muted); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 2rem; left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.75rem;
    box-shadow: var(--shadow-lg); z-index: 9999; font-size: 0.9rem;
    text-align: center; max-width: 380px; width: 90%; line-height: 1.5;
    transition: transform 0.42s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Hero socials (editorial inline links, with brand-coloured underline on hover) ---------- */
.hero-socials {
    margin-top: 1.4rem;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}
.hero-socials .socials-label {
    display: block;
    font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    opacity: 0.85;
}
.hero-socials a {
    color: var(--text);
    position: relative;
    padding: 0 1px;
    transition: color 0.25s;
    white-space: nowrap;
}
.hero-socials a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}
.hero-socials a:hover { color: var(--primary); }
.hero-socials a:hover::after { transform: scaleX(1); }
.hero-socials .socials-sep {
    color: var(--text-muted);
    opacity: 0.42;
    margin: 0 0.18rem;
    user-select: none;
}
/* brand-tinted underline on hover */
.hero-socials a[data-brand="ig"]:hover::after { background: #E4405F; }
.hero-socials a[data-brand="li"]:hover::after { background: #0A66C2; }
.hero-socials a[data-brand="ss"]:hover::after { background: #FF6719; }
.hero-socials a[data-brand="x"]:hover::after  { background: #1A1614; }
.hero-socials a[data-brand="tt"]:hover::after { background: #1A1614; }
.hero-socials a[data-brand="th"]:hover::after { background: #1A1614; }
.hero-socials a[data-brand="fb"]:hover::after { background: #0866FF; }
[data-theme="dark"] .hero-socials a[data-brand="x"]:hover::after,
[data-theme="dark"] .hero-socials a[data-brand="tt"]:hover::after,
[data-theme="dark"] .hero-socials a[data-brand="th"]:hover::after { background: #F4F0E8; }

/* ---------- Article hero image ---------- */
.article-hero-image { margin: 0 0 2.5rem; }
.article-hero-image img {
    width: 100%; height: auto; display: block;
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.article-hero-caption {
    font-size: 0.82rem; color: var(--text-muted); font-style: italic;
    margin-top: 0.7rem; text-align: center; line-height: 1.5;
}

/* ---------- Tags / chips ---------- */
.tag {
    display: inline-block; padding: 0.38rem 1rem; border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 500; background: var(--surface-alt);
    color: var(--primary); border: 1px solid var(--border); transition: all 0.22s; cursor: default;
}
.tag:hover { background: var(--primary); color: white; border-color: var(--primary); transform: translateY(-2px); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .section { padding: 70px 0; }
    .article-list { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .newsletter-banner { padding: 2rem; }
}
