:root {
    --header-height: 60px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: var(--header-height);
}

.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.7rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

:target, section:target, [id] {
    scroll-margin-top: var(--header-height);
}

/* Broader compatibility for headings often used as targets */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
    scroll-margin-top: calc(var(--header-height) + 0.5rem);
}

.nav-link:hover {
    color: #ffc107 !important;
}

section h2 {
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 2px;
}

.hero-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.45) 0%, rgba(19, 179, 213, 0.45) 100%), url('../images/porto-de-galinhas/hero-beach.png');
    background-size: cover;
    background-position: right;
    background-attachment: fixed;
    color: white;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    box-sizing: border-box;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 800;
}

.hero-section .lead {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.card-title {
    font-weight: 600;
}

#committee .card {
    border-top: 4px solid #0d6efd;
}

.committee-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 3px solid #f8f9fa;
    transition: border-color 0.3s ease;
}

.card:hover .committee-photo {
    border-color: #0d6efd;
}

.organization-logo {
    max-height: 180px;
    width: auto;
    max-width: 100%;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(0%);
}

.organization-logo:hover {
    transform: scale(1.10);
    filter: grayscale(0%) brightness(1.1);
}

.btn-light {
    font-weight: 600;
    border: 2px solid white;
    transition: all 0.3s ease;
}

.btn-light:hover {
    background: white;
    color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}

.list-group-item {
    transition: border-left-color 0.3s ease, background-color 0.3s ease;
}

.list-group-item:hover {
    border-left: 4px solid;
    border-left-color: #0d6efd;
    color: #000000 !important;
    background-color: #f8f9fa !important;
}

.alert {
    border-left: 4px solid;
    border-radius: 0.5rem;
}

.alert-info {
    border-left-color: #0dcaf0;
}

.alert-primary {
    border-left-color: #0d6efd;
}

.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
}

#history .card {
    border-top: 4px solid #0d6efd;
}

@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll;
    }
    .organization-logo {
        max-height: 120px;
    }
}
