/* ============================================
   MARITIME OGMIOS BOOKS — Design Token System
   3-tier: Primitives → Semantic → Component
   ============================================ */

/* ===== TIER 1 — PRIMITIVES (raw values) ===== */
:root {
    /* Navy palette */
    --navy-900: #0a1628;
    --navy-800: #0f1f3a;
    --navy-700: #142238;
    --navy-600: #1a2d4d;
    --navy-500: #1e3a5f;

    /* Frost palette */
    --frost-100: #e8f4f8;
    --frost-200: #a8c5d1;
    --frost-300: #6b8a9a;

    /* Accent palette — teal */
    --cyan-400: #00d8a8;
    --cyan-600: #00a882;
    --cyan-200: #66f0d0;

    /* Status palette */
    --green-400: #00d68f;
    --amber-400: #ffaa00;
    --red-400: #ff6b6b;

    /* Badge palette */
    --indigo-400: #5b7fd8;
    --teal-400: #00d8a8;

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Shadows (primitives) */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ===== TIER 2 — SEMANTIC (overridable per site) ===== */
:root {
    --brand-hue: 160;

    /* Accent */
    --accent-primary: var(--cyan-400);
    --accent-secondary: var(--cyan-600);
    --accent-tertiary: var(--cyan-200);

    /* Backgrounds */
    --color-bg-primary: var(--navy-900);
    --color-bg-secondary: var(--navy-800);
    --color-bg-surface: var(--navy-700);
    --color-bg-surface-hover: var(--navy-600);

    /* Text */
    --color-text-primary: var(--frost-100);
    --color-text-secondary: var(--frost-200);
    --color-text-muted: var(--frost-300);

    /* Status */
    --color-success: var(--green-400);
    --color-warning: var(--amber-400);
    --color-danger: var(--red-400);

    /* Border */
    --color-border: var(--navy-500);
    --color-border-glow: rgba(0, 216, 168, 0.3);

    /* Glow shadow */
    --shadow-glow: 0 0 30px rgba(0, 216, 168, 0.2);
}

/* ===== TIER 3 — COMPONENT ===== */
:root {
    /* Card */
    --card-bg: var(--color-bg-surface);
    --card-bg-hover: var(--color-bg-surface-hover);
    --card-border: var(--color-border);
    --card-border-hover: var(--accent-secondary);

    /* Button */
    --button-bg: var(--accent-secondary);
    --button-bg-hover: var(--accent-primary);
    --button-text: #ffffff;

    /* Header */
    --header-bg: rgba(10, 22, 40, 0.95);
    --header-border: var(--color-border);

    /* Links */
    --link-color: var(--accent-primary);
    --link-color-hover: var(--accent-tertiary);

    /* Body gradients */
    --body-gradient-accent: rgba(0, 216, 168, 0.05);
    --hero-gradient-accent: rgba(0, 168, 130, 0.15);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at top, var(--body-gradient-accent) 0%, transparent 50%),
        linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ===== HEADER ===== */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--color-text-primary);
    text-decoration: none;
}

.logo:hover {
    color: var(--color-text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.site-badge {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.site-badge--filled {
    background: var(--accent-primary);
    color: var(--color-bg-primary);
}

.site-badge--outlined {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.hub-link {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.hub-link:hover {
    background: var(--accent-primary);
    color: var(--color-bg-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

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

.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-link {
    font-size: 1.3rem;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.lang-link:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.lang-link.active {
    opacity: 1;
}

/* ===== HERO (landing) ===== */
.hero-landing {
    padding: 50px 20px 30px;
    text-align: center;
    background: linear-gradient(135deg, var(--hero-gradient-accent) 0%, transparent 60%);
    border-bottom: 1px solid var(--color-border);
}

.hero-landing h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 650px;
    margin: 0 auto 15px;
    line-height: 1.6;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--button-bg);
    color: var(--button-text);
}

.btn-primary:hover {
    background: var(--button-bg-hover);
    color: var(--button-text);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: var(--color-bg-primary);
}

/* ===== SECTION ===== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--color-text-primary);
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section--featured {
    padding: 35px 0 50px;
}

.section--featured .section-header {
    margin-bottom: 25px;
}

.section--featured .section-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin-bottom: 8px;
}

.section--featured .section-header p {
    font-size: 0.95rem;
}

/* ===== FEATURED BOOKS ===== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.book-featured {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.book-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
}

.book-featured:hover {
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-3px);
}

.book-featured-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.featured-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-primary);
    color: var(--color-bg-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    align-self: flex-start;
}

.book-featured .book-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.book-featured .book-see-details {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.book-featured .book-see-details:hover {
    color: var(--accent-tertiary);
}

/* ===== BOOK CARDS GRID ===== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.book-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
}

.book-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.2s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.3s; }
.book-card:nth-child(7) { animation-delay: 0.35s; }
.book-card:nth-child(8) { animation-delay: 0.4s; }
.book-card:nth-child(9) { animation-delay: 0.45s; }
.book-card:nth-child(10) { animation-delay: 0.5s; }

/* ===== BOOK COVER ===== */
.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(145deg, rgba(0, 216, 168, 0.08) 0%, transparent 50%),
        linear-gradient(325deg, rgba(0, 216, 168, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    border: 1px solid rgba(0, 216, 168, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 16px;
    text-align: left;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.book-cover-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.book-cover-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(10, 22, 40, 0.9) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.book-cover-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-author {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--accent-primary);
    line-height: 1.3;
    position: relative;
    z-index: 1;
    opacity: 0.8;
}

/* ===== BOOK INFO ===== */
.book-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.book-featured .book-title {
    font-size: 1.1rem;
}

.book-authors {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.book-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 2px 8px;
    background: rgba(0, 216, 168, 0.1);
    border-radius: var(--radius-sm);
}

.book-description {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.book-featured .book-description {
    display: none;
}

.book-actions {
    margin-top: 8px;
}

/* ===== CATEGORY SECTIONS ===== */
.category-section {
    border-top: 1px solid var(--color-border);
}

.category-section:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

/* ===== AFFILIATE DISCLOSURE ===== */
.disclosure-banner {
    background: rgba(0, 216, 168, 0.08);
    border: 1px solid rgba(0, 216, 168, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    margin: 10px 0 0;
    text-align: center;
}

.hero-landing .disclosure-banner {
    max-width: 650px;
    margin: 10px auto 0;
}

.disclosure-banner p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ===== AFFILIATE NOTICE ===== */
.affiliate-notice {
    text-align: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.affiliate-notice p {
    margin: 0;
    line-height: 1.5;
}

/* ===== CONTENT PAGES ===== */
.page-content {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--accent-tertiary);
}

.page-content h2 {
    font-size: 1.5rem;
    margin: 40px 0 20px;
    color: var(--color-text-primary);
}

.page-content p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.page-content ul, .page-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
    color: var(--color-text-secondary);
}

.page-content li {
    margin-bottom: 10px;
}

.page-content a {
    color: var(--link-color);
}

.page-content a:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

.page-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

.page-content em {
    color: var(--color-text-muted);
}

.page-content code {
    background: var(--card-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 80px;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--color-text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.footer-section ul a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.footer-credits {
    margin-top: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-landing {
        padding: 60px 20px 50px;
    }

    .section {
        padding: 50px 0;
    }

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

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        grid-template-columns: 100px 1fr;
        gap: 15px;
        padding: 20px;
    }

    .nav {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-right {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .book-card {
        grid-template-columns: 80px 1fr;
        gap: 12px;
        padding: 15px;
    }

    .book-title {
        font-size: 0.9rem;
    }

    .book-description {
        font-size: 0.8rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}