/*
 * sarwater.css - Unified CSS style for SARWater project
 * Supports both home page (hero layout) and internal pages (standard layout)
 *
 * Copyright (C) 2025 Francesco P. Lovergine <francesco.lovergine@cnr.it>
 */

/* ========================================================================
   BASE STYLES
   ======================================================================== */

:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f8ff;
    --bg-card: #ffffff;
    
    --text-primary: #333;
    --text-secondary: #444;
    --text-tertiary: #666;
    --text-heading: #0a1128;
    --text-heading-secondary: #1a2332;
    --text-heading-tertiary: #2a3342;
    
    --border-light: #e0e0e0;
    --border-medium: #ddd;
    
    --code-bg: #f5f5f5;
    --code-text: #d63384;
    
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #222222;
        --bg-tertiary: #2a2a2a;
        --bg-card: #252525;
        
        --text-primary: #e0e0e0;
        --text-secondary: #d0d0d0;
        --text-tertiary: #b0b0b0;
        --text-heading: #f0f0f0;
        --text-heading-secondary: #e8e8e8;
        --text-heading-tertiary: #d8d8d8;
        
        --border-light: #404040;
        --border-medium: #4a4a4a;
        
        --code-bg: #2a2a2a;
        --code-text: #ff79c6;
        
        --shadow-light: rgba(0, 0, 0, 0.3);
        --shadow-medium: rgba(0, 0, 0, 0.5);
    }
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================================================
   NAVIGATION BAR (SHARED)
   ======================================================================== */

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 17, 40, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0 4rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-logo-img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    background: transparent;
    border-radius: 50%;
}

.nav-logo-text {
    display: flex;
    align-items: baseline;
}

.nav-logo-text .sar {
    color: #ffffff;
}

.nav-logo-text .water {
    color: #2196F3;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
    display: block;
    padding: 0.5rem 0;
}

.nav-menu li a:hover {
    color: #2196F3;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2196F3;
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

/* Dropdown menu styles */
.nav-menu li.has-dropdown > a::before {
    content: '▼';
    font-size: 0.7rem;
    margin-left: 0.4rem;
    transition: transform 0.3s ease;
}

.nav-menu li.has-dropdown:hover > a::before {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(10, 17, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 180px;
    padding: 0.5rem 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-menu li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    padding: 0.75rem 1.5rem;
    color: #e0e0e0;
    white-space: nowrap;
}

.dropdown-menu li a::after {
    display: none;
}

.dropdown-menu li a:hover {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ========================================================================
   HOME PAGE: HERO SECTION
   ======================================================================== */

.hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000000;
    overflow: hidden;
}

/* Space background with stars */
.space-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #000000 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background: white;
    border-radius: 50%;
}

/* Earth hemisphere */
.earth {
    position: absolute;
    bottom: -10%;
    right: -13%;
    width: 900px;
    height: 900px;
    border-radius: 50%;
    background: #000000 url('/assets/images/stack_exp.webp') no-repeat center;
    background-size: contain;
    background-position: center;
    background-size: 90%;
    box-shadow: 
        inset -60px -60px 120px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(100, 181, 246, 0.15);
}

/* Atmospheric glow */
.earth::after {
    content: '';
    position: absolute;
    width: 105%;
    height: 105%;
    top: -2.5%;
    left: -2.5%;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        transparent 60%,
        rgba(100, 181, 246, 0.15) 75%,
        rgba(100, 181, 246, 0.3) 85%,
        transparent 100%);
    pointer-events: none;
}

/* Hero content overlay */
.hero-container .content {
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
    color: white;
    z-index: 10;
    max-width: 800px;
}

.hero-container h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: #b0c4de;
    font-weight: 300;
    line-height: 1.6;
}

.features {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.feature-icon {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
}

.cta-button {
    display: inline-block;
    padding: 14px 35px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background: #1976D2;
}

/* ========================================================================
   INTERNAL PAGES: PAGE HEADER
   ======================================================================== */

.page-header {
    margin-top: 80px;
    background: linear-gradient(135deg, #0d1b3a 0%, #1a2f52 100%);
    color: white;
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    color: #b0c4de;
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================================================
   INTERNAL PAGES: MAIN CONTENT
   ======================================================================== */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: 120px;
}

.content-section {
    margin-bottom: 4rem;
}

.content-section h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #2196F3;
    font-weight: 600;
}

.content-section h3 {
    font-size: 1.5rem;
    color: var(--text-heading-secondary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content-section h4 {
    font-size: 1.2rem;
    color: var(--text-heading-tertiary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.content-section p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    text-align: justify;
}

.content-section ul,
.content-section ol {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 0.5rem;
}

.content-section a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.content-section a:hover {
    color: #1976D2;
    text-decoration: underline;
}

.content-section img,
.main-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
}

/* Highlighted Box */
.highlight-box {
    background: var(--bg-tertiary);
    border-left: 4px solid #2196F3;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.highlight-box h3 {
    color: var(--text-heading);
    margin-top: 0;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 4px 16px var(--shadow-light);
    transform: translateY(-4px);
}

.info-card h3 {
    color: #2196F3;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-card p {
    margin-bottom: 0;
}

/* Table Styles */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-card);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.content-table th,
.content-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.content-table th {
    background: #0a1128;
    color: white;
    font-weight: 600;
}

.content-table tr:hover {
    background: var(--bg-secondary);
}

/* ========================================================================
   NEWSLETTER SECTION (SHARED - OPTIONAL)
   ======================================================================== */

.newsletter-section {
    background: var(--bg-secondary);
    padding: 4rem 2rem;
    text-align: center;
}

.newsletter-section h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
    font-weight: 600;
}

.newsletter-section p {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid var(--border-medium);
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    background: var(--bg-card);
    color: var(--text-primary);
}

.newsletter-input:focus {
    border-color: #2196F3;
}

.newsletter-button {
    padding: 14px 35px;
    background: #5a7a8f;
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.newsletter-button:hover {
    background: #4a6a7f;
}

/* ========================================================================
   FOOTER SECTION (SHARED)
   ======================================================================== */

.footer-container {
    background: #0a1128;
    color: #e0e0e0;
    margin-top: 0;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    max-height: 300px;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
    background: #050814;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.footer-links a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.footer-links a:hover {
    color: #2196F3;
}

/* Footer Feed Icon */
.footer-feed-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.footer-feed-icon::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b0b0b0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.footer-feed-icon:hover {
    color: white !important;
    background: #2196F3;
    border-color: #2196F3;
    text-decoration: none;
}

.footer-feed-icon:hover::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/></svg>');
}

/* Copyright Section */
.footer-copyright {
    text-align: center;
    padding: 2rem;
    background: #000000;
    color: #808080;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-copyright p {
    margin: 0.5rem 0;
}

.footer-copyright a {
    color: #2196F3;
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

.esa-funding {
  font-size: 0.85rem;
  line-height: 1.3;
  color: #666;
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    nav {
        padding: 0 2rem;
    }

    .earth {
        width: 600px;
        height: 600px;
        bottom: -25%;
        right: -15%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    nav {
        padding: 0 1rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(10, 17, 40, 0.98);
        width: 100%;
        text-align: left;
        transition: left 0.3s ease;
        gap: 0;
        padding: 2rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 0 2rem;
    }

    .nav-menu li a {
        padding: 1rem 0;
    }

    /* Mobile dropdown styles */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.3);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu li.has-dropdown.active .dropdown-menu {
        max-height: 300px;
    }

    .dropdown-menu li {
        padding: 0;
    }

    .dropdown-menu li a {
        padding: 0.75rem 0 0.75rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
    }

    /* Hero section mobile adjustments */
    .hero-container .content {
        left: 5%;
        right: 5%;
        max-width: 90%;
    }
    
    .hero-container h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .earth {
        width: 400px;
        height: 400px;
        bottom: -20%;
        right: -20%;
    }

    /* Page header mobile adjustments */
    .page-header {
        padding: 3rem 1.5rem 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* Main content mobile adjustments */
    .main-content {
        padding: 2rem 1.5rem;
    }

    .content-section h2 {
        font-size: 1.7rem;
    }

    .content-section h3 {
        font-size: 1.3rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .content-table {
        font-size: 0.9rem;
    }

    .content-table th,
    .content-table td {
        padding: 0.75rem;
    }

    /* Newsletter mobile adjustments */
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }

    .newsletter-input {
        border-right: 2px solid #ddd;
        border-radius: 4px;
    }

    .newsletter-button {
        border-radius: 4px;
    }

    /* Footer mobile adjustments */
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        max-height: 400px;
    }

    .gallery-item {
        height: 200px;
    }

    .footer-links {
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }
}
``
/* ========================================================================
   BLOG POSTS AND COLLECTIONS
   ======================================================================== */

/* Collection Pages (news.html, tag pages) */
.collection-header {
    text-align: center;
    padding: 2rem 0 3rem;
    background: linear-gradient(135deg, #0d1b3a 0%, #1a2f52 100%);
    color: white;
    /* margin-top: 130px; /* Account for fixed nav */
}

.collection-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
}

.posts-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Post Summary Cards (in collection pages) */
.post-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.post-summary:hover {
    box-shadow: 0 4px 12px var(--shadow-light);
    transform: translateY(-2px);
}

.post-summary header {
    margin-bottom: 1rem;
}

.post-summary-title {
    color: var(--text-heading);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.post-summary-title:hover {
    color: #2196F3;
}

.post-date {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-summary-content {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 1rem 0;
}

.post-summary-content p {
    margin: 0;
}

.post-summary footer {
    margin-top: 1rem;
}

.read-more {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #1976D2;
    text-decoration: underline;
}

/* Individual Post Pages */
.post-article {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
}

.post-header {
    background: linear-gradient(135deg, #0d1b3a 0%, #1a2f52 100%);
    color: white;
    padding: 4rem 2rem 3rem;
    text-align: center;
    /*margin-top: 130px; /* Account for fixed nav */
}

.post-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #b0c4de;
}

.post-meta .post-date {
    display: inline;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-tags span {
    color: #b0c4de;
}

.tag {
    background: rgba(33, 150, 243, 0.2);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.tag:hover {
    background: rgba(33, 150, 243, 0.4);
}

.post-content {
    padding: 3rem 2rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #2196F3;
    font-weight: 600;
}

.post-content h3 {
    font-size: 1.5rem;
    color: var(--text-heading-secondary);
    margin: 1.5rem 0 1rem;
    font-weight: 600;
}

.post-content h4 {
    font-size: 1.2rem;
    color: var(--text-heading-tertiary);
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 2rem;
    color: var(--text-secondary);
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--code-text);
}

.post-content pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.post-content blockquote {
    border-left: 4px solid #2196F3;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-tertiary);
    font-style: italic;
}

.post-content a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: #1976D2;
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0 auto;
    display: block;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    text-align: left;
}

.post-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Mastodon Comments Section */
.mastodon-comments {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-light);
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.mastodon-comments p {
    color: var(--text-tertiary);
    margin: 0;
}

.mastodon-comments a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
}

.mastodon-comments a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.pagination-prev,
.pagination-next {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border: 2px solid #2196F3;
    border-radius: 4px;
    transition: background 0.3s ease, color 0.3s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: #2196F3;
    color: white;
}

/* Captioned images */
figure.captioned-image {
    text-align: center;
    margin: 2em auto;
    max-width: 100%;
}

figure.captioned-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0.5em;
}

figure.captioned-image figcaption {
    font-style: italic;
    font-weight: bold;
    color: #aaa;
    font-size: 0.9em;
    margin-top: 0.5em;
    padding: 0 1em;
}


/* Responsive adjustments for posts/collections */
@media (max-width: 768px) {
    .collection-title,
    .post-title {
        font-size: 2rem;
    }
    
    .post-summary {
        padding: 1.5rem;
    }
    
    .post-summary-title {
        font-size: 1.5rem;
    }
    
    .post-content {
        padding: 2rem 1.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .posts-list {
        padding: 2rem 1rem;
    }
}

/* ========================================================================
   TAGS INDEX PAGE
   ======================================================================== */

#tags-index {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    list-style: none;
}

#tags-index li {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

#tags-index li:hover {
    box-shadow: 0 4px 12px var(--shadow-light);
    transform: translateX(4px);
}

#tags-index li a {
    color: #2196F3;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

#tags-index li a:hover {
    color: #1976D2;
    text-decoration: underline;
}

#tags-index li .feed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0.4rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    font-size: 0;
    width: 28px;
    height: 28px;
}

#tags-index li .feed-icon::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#tags-index li .feed-icon:hover {
    background: #2196F3;
    border-color: #2196F3;
    text-decoration: none;
}

#tags-index li .feed-icon:hover::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/></svg>');
}

@media (prefers-color-scheme: dark) {
    #tags-index li .feed-icon::before {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23b0b0b0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/></svg>');
    }
}

/* Tags page title */
body > h1 {
    margin-top: 100px;
    padding: 3rem 2rem 2rem;
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-heading);
    background: linear-gradient(135deg, #0d1b3a 0%, #1a2f52 100%);
    color: white;
}

@media (max-width: 768px) {
    #tags-index {
        padding: 2rem 1rem;
    }
    
    #tags-index li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    #tags-index li .feed-icon {
        margin-left: 0;
    }
    
    body > h1 {
        font-size: 2rem;
        padding: 2rem 1.5rem 1.5rem;
    }
}

/* Reduce padding-top on main-content when it follows page-header (flat pages only) */
.page-header + .main-content {
    padding-top: 3rem !important;
}


/* ========================================================================
   ALT TEXT ACCESSIBILITY FEATURE
   ======================================================================== */

/* Wrapper for images with ALT button */
.alt-text-wrapper {
    position: relative !important;
    display: block !important;
    width: fit-content !important;
    margin: 1.5rem auto !important;
    max-width: 100% !important;
    vertical-align: top !important;
    line-height: 0 !important;
}

.alt-text-wrapper img {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top !important;
}

/* ALT button - positioned in top-right corner of image */
.alt-text-button {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    background: rgba(0, 0, 0, 0.75) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    z-index: 100 !important;
    transition: all 0.2s ease !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    margin: 0 !important;
}

.alt-text-button:hover,
.alt-text-button:focus {
    background: rgba(33, 150, 243, 0.95) !important;
    border-color: rgba(33, 150, 243, 1) !important;
    transform: scale(1.1) !important;
    outline: none !important;
}

.alt-text-button:focus-visible {
    outline: 2px solid #2196F3 !important;
    outline-offset: 2px !important;
}

.alt-text-button[aria-expanded="true"] {
    background: rgba(33, 150, 243, 0.9) !important;
    border-color: rgba(33, 150, 243, 1) !important;
}

/* Tooltip balloon */
.alt-text-tooltip {
    position: absolute !important;
    top: 40px !important;
    right: 8px !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: 8px !important;
    padding: 12px 32px 12px 12px !important;
    max-width: 300px !important;
    min-width: 200px !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    box-shadow: 0 4px 12px var(--shadow-medium) !important;
    z-index: 20 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    word-wrap: break-word !important;
}

.alt-text-tooltip.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Close button in tooltip */
.alt-text-close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-tertiary) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s ease !important;
}

.alt-text-close:hover,
.alt-text-close:focus {
    color: var(--text-primary) !important;
    outline: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .alt-text-tooltip {
        max-width: calc(100vw - 40px) !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(-10px) !important;
    }
    
    .alt-text-tooltip.visible {
        transform: translateX(-50%) translateY(0) !important;
    }
}
