/*
Theme Name: Kayaking Geek
Theme URI: https://kayakinggeek.com
Author: Joseph Rounds
Description: A custom theme for kayakinggeek.com -- sea kayaking trips, gear, and routes.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: kayakinggeek
*/

:root {
    --navy: #0b2e3c;
    --navy-deep: #071e28;
    --teal: #1f7a8c;
    --teal-light: #4fa8b8;
    --sand: #f6f1e7;
    --sand-dark: #e8dfc9;
    --coral: #e8734a;
    --brass: #b8905a;
    --brass-light: #e3c896;
    --ink: #1a2226;
    --ink-soft: #4a5a61;
    --white: #ffffff;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Fraunces", var(--font);
    --max-width: 1160px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--sand);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--brass);
    color: var(--navy-deep);
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--sand);
}

::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 10px;
    border: 3px solid var(--sand);
}

img {
    max-width: 100%;
    display: block;
}

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

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

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Reveal-on-scroll (progressive enhancement -- see assets/js/interactions.js) */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brass-light) 0%, var(--brass) 100%);
    color: var(--navy-deep);
    box-shadow: 0 10px 24px rgba(184, 144, 90, 0.35);
}

.btn-primary:hover {
    color: var(--navy-deep);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(184, 144, 90, 0.45);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
    backdrop-filter: blur(6px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--white);
    color: var(--white);
    transform: translateY(-2px);
}

/* Header */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 26px 0;
    background: linear-gradient(180deg, rgba(7, 30, 40, 0.6) 0%, rgba(7, 30, 40, 0) 100%);
    transition: background 0.4s var(--ease), padding 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

/*
 * Hero vs. non-hero is decided once per page load in PHP (is_front_page()),
 * not by scroll position -- so this can't drive the "solid vs. transparent"
 * look, or a transparent white-text header would stay pinned over the white
 * content sections below the hero on the homepage. is-scrolled is toggled by
 * assets/js/interactions.js instead, uniformly on every page.
 */
.site-header.is-scrolled {
    background: rgba(11, 46, 60, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    padding: 16px 0;
    box-shadow: 0 8px 30px rgba(7, 30, 40, 0.18);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-branding a {
    font-family: var(--font-display);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.primary-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.primary-nav a {
    position: relative;
    display: inline-block;
    padding: 4px 0;
    color: var(--white);
    font-weight: 500;
    font-size: 0.95rem;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -2px;
    height: 2px;
    background: var(--brass-light);
    transition: right 0.3s var(--ease);
}

.primary-nav a:hover {
    color: var(--white);
}

.primary-nav a:hover::after {
    right: 0;
}

/* Mobile nav: hidden by default (desktop shows the plain inline list above),
   only kicks in under the breakpoint. Four nav items (Home/Forum/Log
   In/Register) plus the wordmark stopped fitting on one line once
   registration shipped -- this used to just be Home + Forum. */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
    display: none;
}

@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    .primary-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(78vw, 320px);
        background: var(--navy-deep);
        padding: 100px 32px 32px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.35s var(--ease);
        z-index: 100;
    }

    .primary-nav.is-open {
        transform: translateX(0);
        box-shadow: -30px 0 60px rgba(0, 0, 0, 0.35);
    }

    .primary-nav ul {
        flex-direction: column;
        gap: 26px;
    }

    .primary-nav a {
        font-size: 1.1rem;
        text-shadow: none;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(7, 30, 40, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s var(--ease);
        z-index: 99;
    }

    .nav-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Hero */

.hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(7, 30, 40, 0.4) 0%, rgba(7, 30, 40, 0.8) 100%),
        url("assets/images/hero-sunset.jpg") center 65% / cover no-repeat;
    color: var(--white);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.25;
    pointer-events: none;
}

.hero-content {
    position: relative;
    padding: 90px 0 84px;
    width: 100%;
}

.hero-eyebrow,
.hero h1,
.hero p,
.hero-actions {
    opacity: 0;
    animation: hero-rise 0.9s var(--ease) both;
}

.hero-eyebrow {
    animation-delay: 0.05s;
}

.hero h1 {
    animation-delay: 0.18s;
}

.hero p {
    animation-delay: 0.32s;
}

.hero-actions {
    animation-delay: 0.46s;
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brass-light);
    margin: 0 0 18px;
}

.hero-eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--brass-light);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    line-height: 1.02;
    margin: 0 0 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.hero h1 em {
    font-style: italic;
    font-weight: 500;
    background: linear-gradient(100deg, var(--brass-light) 10%, var(--white) 50%, var(--brass-light) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 46ch;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 36px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    width: 22px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
}

.hero-scroll-cue::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--brass-light);
    border-radius: 3px;
    transform: translateX(-50%);
    animation: scroll-cue 1.8s ease-in-out infinite;
}

@keyframes scroll-cue {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 0);
    }
}

/* Intro band */

.intro {
    position: relative;
    background: var(--white);
    padding: 84px 0;
    border-bottom: 1px solid var(--sand-dark);
}

.intro .wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.intro > .wrap > div {
    position: relative;
    padding: 34px 28px 30px;
    border-radius: 16px;
    background: var(--sand);
    border: 1px solid var(--sand-dark);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.intro > .wrap > div:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px rgba(11, 46, 60, 0.1);
    border-color: var(--brass-light);
}

.intro > .wrap > div::before {
    counter-increment: intro-count;
    content: counter(intro-count, decimal-leading-zero);
    display: block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--brass);
    margin-bottom: 14px;
}

.intro .wrap {
    counter-reset: intro-count;
}

.intro h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: var(--navy);
}

.intro p {
    color: var(--ink-soft);
    margin: 0;
}

/* Section headings shared by feature grid + posts */

.grid-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 16px;
}

.grid-heading h2 {
    position: relative;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    color: var(--navy);
    margin: 0;
    padding-left: 22px;
}

.grid-heading h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--brass-light), var(--coral));
}

.grid-heading span {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Photo feature grid (bento) */

.feature-grid {
    padding: 84px 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px;
    gap: 16px;
}

.photo-grid figure:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.photo-grid figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--sand-dark);
    box-shadow: 0 12px 30px rgba(11, 46, 60, 0.08);
    perspective: 800px;
}

.photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.photo-grid figure.is-tilting img {
    transition: transform 0.1s linear;
}

/*
 * Cursor-tracking sheen -- assets/js/interactions.js sets --mx/--my to the
 * pointer position on mousemove. Purely decorative, so it just no-ops (stays
 * centered, invisible) when JS is unavailable or the device has no fine
 * pointer to hover with.
 */
.photo-grid figure::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), transparent 55%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    mix-blend-mode: overlay;
}

.photo-grid figure:hover::before {
    opacity: 1;
}

.photo-grid figure::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 30, 40, 0) 55%, rgba(7, 30, 40, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

.photo-grid figure:hover::after {
    opacity: 1;
}

.photo-grid figure:hover img {
    transform: scale(1.08);
}

.photo-grid figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 16px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(7, 30, 40, 0.8) 100%);
}

@media (max-width: 900px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }

    .photo-grid figure:first-child {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* Posts */

.posts-band {
    background: var(--white);
    padding: 84px 0 100px;
    border-top: 1px solid var(--sand-dark);
    scroll-margin-top: 90px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.post-card {
    background: var(--sand);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--sand-dark);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 44px rgba(11, 46, 60, 0.14);
    border-color: var(--brass-light);
}

.post-card .thumb {
    aspect-ratio: 16 / 10;
    background: var(--sand-dark) center / cover no-repeat;
    overflow: hidden;
}

.post-card .thumb.placeholder {
    background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
}

.post-card-body {
    padding: 24px;
}

.post-card time {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brass);
    font-weight: 700;
}

.post-card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 12px 0 10px;
    line-height: 1.35;
}

.post-card h3 a {
    color: var(--ink);
}

.post-card h3 a:hover {
    color: var(--coral);
}

.post-card p {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin: 0;
}

.post-card .more-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s var(--ease), color 0.3s var(--ease);
}

.post-card:hover .more-link {
    color: var(--coral);
    text-decoration-color: currentColor;
}

.empty-state {
    background: var(--sand);
    border: 1px dashed var(--sand-dark);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    color: var(--ink-soft);
}

/* Single post / page */

.entry-header {
    position: relative;
    background: var(--navy-deep);
    background-image: radial-gradient(circle at 15% 20%, rgba(184, 144, 90, 0.18), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(31, 122, 140, 0.35), transparent 50%);
    color: var(--white);
    padding: 150px 0 64px;
}

.entry-header .wrap {
    max-width: 760px;
}

.entry-header time {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--brass-light);
    font-weight: 700;
}

.entry-header h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    margin: 16px 0 0;
    line-height: 1.15;
}

.entry-content-wrap {
    background: var(--white);
    padding: 56px 0 90px;
}

.entry-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.08rem;
    color: var(--ink);
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content img {
    border-radius: 12px;
    margin: 28px 0;
    box-shadow: 0 20px 40px rgba(11, 46, 60, 0.14);
}

.entry-content h2 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--navy);
    margin-top: 2.2em;
}

.entry-content a {
    text-decoration: underline;
    text-decoration-color: var(--brass);
    text-underline-offset: 3px;
}

.entry-content blockquote {
    border-left: 3px solid var(--coral);
    margin: 28px 0;
    padding: 4px 0 4px 20px;
    color: var(--ink-soft);
    font-style: italic;
}

/* Footer */

.site-footer {
    position: relative;
    background: var(--navy-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 44px 0;
    font-size: 0.9rem;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

.site-footer .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.site-footer p {
    margin: 0;
}

.site-footer .footer-credit {
    margin-top: 6px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
    color: var(--brass-light);
}

@media (max-width: 640px) {
    .site-footer .wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .hero-content {
        padding: 76px 0 56px;
    }

    .intro {
        padding: 64px 0;
    }

    .feature-grid,
    .posts-band {
        padding: 64px 0;
    }
}
