/* 
   Veïns del Port - Base Styles 
   Focus: Clarity, Simplicity, Premium Institutional Tone
*/

:root {
    /* Color Palette from veinsdelport.com */
    --primary-color: #333333; 
    --secondary-color: #555555;
    --accent-color: #4d7b1b; /* Original Green */
    --background-color: #ecefef; /* Original Background */
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #7f8c8d;
    --border-color: #dcdde1;
    --official-bg: #ffffff; 
    
    /* Typography from veinsdelport.com */
    --font-main: 'Karla', sans-serif;
    --font-header: 'Poppins', sans-serif;
    
    /* Spacing */
    --gap: 1.5rem;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-padding-top: 100px; /* Offset for sticky header */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 4rem;
}

body > header {
    background: var(--card-bg);
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1100; /* Increased to ensure it's above all content */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center; /* Vertical alignment */
}

nav a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 700; /* Bold */
    font-size: 1rem;
    transition: color 0.3s;
    font-family: var(--font-header);
    white-space: nowrap;
}

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

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1201; /* Higher than header and nav */
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--card-bg);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: right 0.4s ease;
        padding: 5rem 2rem;
        z-index: 1200;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    nav a {
        font-size: 1.2rem;
        white-space: normal;
    }

    /* Animate Hamburger */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--gap);
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--gap);
}

#noticies, #faq, #consulta {
    scroll-margin-top: 120px; /* Force offset for anchor links */
}

h1, h2, h3 {
    font-family: var(--font-header);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

/* Hero Section */
.hero {
    background-image: url('https://veinsdelport.com/images/IMG-20200216-WA0008.jpg');
    background-size: cover;
    background-position: center;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    text-align: center;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 600px;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* News Section Styles */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    background: white;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.news-img {
    width: 200px;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.news-content {
    flex-grow: 1;
}

@media (max-width: 600px) {
    .news-item {
        flex-direction: column;
    }
    .news-img {
        width: 100%;
        height: 180px;
    }
}

.news-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
}

.news-tag {
    background: var(--official-bg);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Official Links Sidebar */
.sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.official-link {
    display: block;
    background: var(--official-bg);
    padding: 1.2rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid var(--accent-color);
    transition: background 0.3s;
}

.official-link:hover {
    background: #d0e7f9;
}

.official-link span {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

/* Post Detail Page Styles */
.post-container {
    max-width: 900px;
    margin: 3rem auto;
    display: block;
}

.post {
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 1.5rem; /* Additional breathing room below header */
}

@media (max-width: 768px) {
    .post {
        padding: 1.5rem;
        border-radius: 0;
    }
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap; /* Changed from nowrap to wrap */
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.5rem;
    margin: 1.5rem 0 0 0;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .post-header h1 {
        font-size: 1.8rem;
    }
}

.back-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.post-header .news-meta {
    margin: 0 !important;
    white-space: nowrap;
    font-size: 0.85rem;
}

.post-hero-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.post-content {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.post-content h2, .post-content h3, .post-content h4 {
    margin-top: 2rem;
}

.post-content ul {
    margin: 1rem 0 1rem 1.5rem;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
}
.faq-search {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.faq-question {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    padding-top: 1rem;
    color: var(--secondary-color);
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Buttons */
.btn {
    background: var(--accent-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Resource List Styles */
.resource-cat h3 {
    font-size: 1.2rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.resource-list {
    list-style: none;
}

.resource-list li {
    margin-bottom: 0.8rem;
}

.resource-list a {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1rem;
    transition: color 0.3s;
}

.resource-list a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

nav a.active {
    color: var(--accent-color);
}

/* CTA Block Styles */
.cta-block {
    text-align: center;
    margin-top: 3rem;
    padding: 3rem 2rem;
    background: var(--official-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.cta-block h3 {
    margin-bottom: 1.5rem;
}

.cta-block p {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-block .btn {
    margin: 0.5rem;
}

@media (max-width: 600px) {
    .cta-block .btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
        margin: 0.5rem 0;
    }
}
