/* ============================================
   Napoli Viva — Vivid Mediterranean Theme
   Font: Space Grotesk (headings) + Newsreader (body)
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-page: #FFFFFF;
    --bg-subtle: #F0F4FA;
    --bg-card: #FFFFFF;
    --cobalt: #1565C0;
    --cobalt-light: #1E88E5;
    --cobalt-dark: #0D47A1;
    --coral: #E86830;
    --coral-light: #F07B48;
    --coral-dark: #D05520;
    --text-dark: #1A1A2E;
    --text-body: #2E2E3E;
    --text-muted: #6B7280;
    --border-light: #D1D5DB;
    --max-content: 720px;
    --max-wide: 1080px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Newsreader', Georgia, serif;
    background-color: var(--bg-page);
    color: var(--text-body);
    line-height: 1.75;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--cobalt-dark);
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
}

h1 { font-size: 2.4rem; margin-bottom: 0.5em; }
h2 { font-size: 1.6rem; margin-top: 2.2em; margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; margin-top: 1.5em; margin-bottom: 0.4em; }
h4 { font-size: 1.05rem; margin-top: 1.2em; margin-bottom: 0.3em; }

p {
    margin-bottom: 1.3em;
    color: var(--text-body);
}

ul, ol {
    margin-bottom: 1.3em;
    padding-left: 1.4em;
}

li {
    margin-bottom: 0.5em;
}

blockquote {
    border-left: 3px solid var(--coral);
    padding: 1em 1.5em;
    margin: 1.8em 0;
    background: var(--bg-page);
    font-style: italic;
    color: var(--text-muted);
    border-radius: 0 4px 4px 0;
}

strong {
    color: var(--text-dark);
    font-weight: 700;
}

/* --- Navigation (site-nav) --- */
.site-nav {
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-page);
}

.nav-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

.site-logo {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-logo a {
    color: var(--text-dark);
}

.site-logo a:hover {
    color: var(--cobalt);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cobalt);
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* --- Hero (index) --- */
.hero {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 3rem 2rem 1rem;
}

.hero-tagline {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 0.6rem;
}

.hero h1 {
    font-size: 2.8rem;
    letter-spacing: -0.02em;
    max-width: 600px;
    margin-bottom: 0.4em;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.6;
}

/* --- Featured Article Card --- */
.featured-card {
    max-width: var(--max-wide);
    margin: 2rem auto 0;
    padding: 0 2rem;
}

.featured-card a {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-height: 320px;
    background: linear-gradient(135deg, var(--cobalt-dark), var(--cobalt));
    transition: transform 0.25s, box-shadow 0.25s;
}

.featured-card a:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(21, 101, 192, 0.15);
}

.featured-inner {
    position: relative;
    z-index: 2;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 320px;
    color: #fff;
}

.featured-tag {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.8rem;
}

.featured-inner h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 0 0 0.5em;
    max-width: 560px;
}

.featured-excerpt {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    max-width: 480px;
    line-height: 1.5;
    margin: 0;
}

.featured-meta {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    margin-top: 1rem;
}

/* --- Article Feed (magazine layout) --- */
.feed-heading {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 3rem 2rem 1rem;
}

.feed-heading h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-dark);
}

.article-feed {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.feed-item {
    display: flex;
    align-items: stretch;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feed-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* Alternate thumbnail position */
.feed-item:nth-child(even) {
    flex-direction: row-reverse;
}

.feed-thumb {
    width: 260px;
    min-height: 180px;
    flex-shrink: 0;
    background-color: var(--bg-subtle);
    background-size: cover;
    background-position: center;
}

.feed-body {
    padding: 1.3rem 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.feed-tag {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--coral);
    margin-bottom: 0.4rem;
}

.feed-body h3 {
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.feed-body h3 a {
    color: var(--text-dark);
    transition: color 0.2s;
}

.feed-body h3 a:hover {
    color: var(--cobalt);
}

.feed-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.6rem;
}

.feed-meta {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Article Hero (article pages) --- */
.article-hero {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 2rem 2rem 1.5rem;
}

.article-hero .feed-tag {
    font-size: 0.76rem;
    margin-bottom: 0.7rem;
}

.article-hero h1 {
    font-size: 2.2rem;
    max-width: 640px;
    margin-bottom: 0.6rem;
}

.article-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.article-meta a {
    color: var(--cobalt);
}

/* --- Breadcrumbs --- */
.breadcrumb {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 1rem 2rem 0;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--cobalt);
}

.breadcrumb .sep {
    margin: 0 0.4em;
    color: var(--border-light);
}

/* --- Article Content --- */
.article-content {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.article-content h2 {
    position: relative;
    padding-bottom: 0.3em;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--cobalt);
    border-radius: 2px;
}

.article-content figure {
    margin: 2em 0;
}

.article-content img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.article-content figcaption {
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5em;
    font-style: italic;
}

/* --- Field Note (practical tip) --- */
.field-note {
    background: var(--bg-subtle);
    border-left: 3px solid var(--cobalt);
    padding: 1.1em 1.4em;
    margin: 1.8em 0;
    border-radius: 0 6px 6px 0;
}

.field-note strong {
    color: var(--cobalt);
}

/* --- Personal Take (author opinion) --- */
.personal-take {
    border-left: 3px solid var(--coral);
    padding: 1.1em 1.4em;
    margin: 2em 0;
    background: var(--bg-page);
}

.personal-take p:first-child {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.6em;
}

.personal-take strong {
    color: var(--coral);
    font-style: normal;
}

/* --- Side Note (small tangent) --- */
.side-note {
    background: #F9FAFB;
    border-radius: 6px;
    padding: 0.9em 1.2em;
    margin: 1.5em 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.side-note strong {
    color: var(--text-dark);
}

/* --- Price Table --- */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
}

.price-table th {
    background: var(--cobalt);
    color: #fff;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    padding: 0.75em 1em;
}

.price-table th:first-child {
    border-radius: 6px 0 0 0;
}

.price-table th:last-child {
    border-radius: 0 6px 0 0;
}

.price-table td {
    padding: 0.65em 1em;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-body);
    font-size: 0.93rem;
}

.price-table tr:last-child td {
    border-bottom: none;
}

.price-table tr:hover td {
    background: rgba(21, 101, 192, 0.04);
}

/* --- Table of Contents --- */
.toc {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1.4em 1.8em;
    margin: 2em 0;
}

.toc-title {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--cobalt);
    margin-bottom: 0.7em;
    letter-spacing: 0.01em;
}

.toc ol {
    padding-left: 1.2em;
    margin: 0;
}

.toc li {
    margin-bottom: 0.3em;
    font-size: 0.9rem;
}

.toc a {
    color: var(--text-muted);
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.toc a:hover {
    color: var(--cobalt);
    border-bottom-color: var(--cobalt);
}

/* --- Related Articles --- */
.related-section {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 0 2rem 3rem;
    border-top: 2px solid var(--border-light);
}

.related-section h2 {
    font-size: 1.2rem;
    color: var(--cobalt);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.related-section h2::after {
    display: none;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.related-link {
    display: block;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1.1em;
    transition: border-color 0.2s, transform 0.2s;
    text-decoration: none;
}

.related-link:hover {
    border-color: var(--cobalt);
    transform: translateY(-2px);
}

.related-tag {
    display: block;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--coral);
    margin-bottom: 0.4em;
}

.related-title {
    display: block;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

/* --- About Page --- */
.about-section {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.about-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.about-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--cobalt);
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

/* --- Footer (3-column layout) --- */
.site-footer {
    border-top: 1px solid var(--border-light);
    padding: 2.5rem 2rem 1.5rem;
    background: var(--bg-subtle);
}

.footer-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h5 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cobalt);
    margin: 0 0 0.6rem;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.footer-col a:hover {
    color: var(--cobalt);
}

.footer-copy {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 1.2rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* --- Responsive --- */
@media (max-width: 800px) {
    .hero h1 {
        font-size: 2rem;
    }

    .article-hero h1 {
        font-size: 1.8rem;
    }

    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.35rem; }

    .featured-inner {
        padding: 2rem;
        min-height: 260px;
    }

    .featured-inner h2 {
        font-size: 1.4rem;
    }

    .feed-item,
    .feed-item:nth-child(even) {
        flex-direction: column;
    }

    .feed-thumb {
        width: 100%;
        min-height: 170px;
        max-height: 210px;
    }

    .article-feed {
        padding: 0 1rem 3rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        padding: 0.8rem 2rem;
        gap: 0;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: block;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-section {
        padding-top: 2rem;
    }
}

@media (max-width: 500px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

    .feed-body {
        padding: 1rem 1.1rem;
    }

    body {
        font-size: 16px;
    }

    .featured-inner {
        padding: 1.5rem;
        min-height: 220px;
    }

    .featured-inner h2 {
        font-size: 1.2rem;
    }
}
