:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-soft: #f5f7fb;
    --text: #1c2739;
    --muted: #556b8d;
    --primary: #0a4da3;
    --primary-dark: #083d82;
    --primary-light: #e1effe;
    --border: #d8dee9;
    --shadow: 0 4px 10px rgba(28, 39, 57, 0.07);
    --scroll-padding: 100px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--scroll-padding);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.4;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    background: #0f4a94;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 12px;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 247, 251, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 3px 8px rgba(28, 39, 57, 0.08);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(1.75rem, 1.4rem + 0.5vw, 2.25rem);
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease-in-out;
}

.brand:active {
    transform: scale(0.98);
}

.brand-icon {
    display: inline-block;
    font-size: 0.74em;
    color: var(--primary);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-icon,
.brand:focus-visible .brand-icon {
    transform: translate(3px, -5px) rotate(-10deg);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.15rem);
    font-weight: 600;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out,
        transform 0.2s ease-in-out;
}

.nav-links a:active {
    transform: scale(0.98);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
    color: var(--text);
    background-color: rgba(10, 77, 163, 0.1);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #ffcd47;
    outline-offset: 4px;
}

main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.section-panel {
    background: linear-gradient(180deg, #f5f7fb 0%, #eff2f7 100%);
    border: 1px solid #e8edf5;
    padding: clamp(60px, 8vw, 120px) clamp(24px, 5vw, 80px);
    margin-top: 0;
}

.hero {
    text-align: center;
    min-height: clamp(480px, 68vh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    position: relative;
    background-image: linear-gradient(rgba(10, 77, 163, 0.45), rgba(10, 77, 163, 0.45)), url('/assets/images/spain-budget-travel.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
}

.hero h1, .hero .hero-subtitle, .hero .eyebrow {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .eyebrow {
    color: #ffd700;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.95rem);
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.45rem, 1.8rem + 4vw, 7.6rem);
    line-height: 1.08;
}

.hero-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    max-width: 32ch;
    font-size: clamp(1.2rem, 1rem + 1vw, 3rem);
}

.hero-cta {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 280px;
    padding: 18px 30px;
    border-radius: 999px;
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.6rem);
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #2d89e6);
    transition: transform 0.2s ease;
}

.hero-cta:hover,
.hero-cta:focus-visible {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.hero-cta:active {
    transform: scale(0.98);
}

.hero-cta span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.hero-cta:hover span,
.hero-cta:focus-visible span {
    transform: translateY(3px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero > * {
    animation: fadeInUp 0.6s ease-out both;
}

.hero .eyebrow { animation-delay: 0.1s; }
.hero h1 { animation-delay: 0.2s; }
.hero .hero-subtitle { animation-delay: 0.3s; }
.hero .hero-cta { animation-delay: 0.4s; }

.section {
    padding: clamp(60px, 7vw, 110px) clamp(12px, 2vw, 20px);
}

.filter-container {
    max-width: 1200px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.search-wrapper {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 16px 24px 16px 50px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 77, 163, 0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--surface-soft);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.section h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(2rem, 1.4rem + 2.1vw, 4.1rem);
    line-height: 1.1;
}

.section-intro {
    color: var(--muted);
    text-align: center;
    margin: 20px auto 0;
    max-width: 42ch;
    font-size: clamp(1.12rem, 0.95rem + 0.65vw, 2.15rem);
}

.guides-grid {
    margin-top: clamp(36px, 4vw, 70px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2vw, 32px);
}

.guide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.guide-card.hidden {
    display: none;
}

.guide-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.guide-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.guide-card:hover .guide-card-image img {
    transform: scale(1.05);
}

.guide-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

.guide-card:hover,
.guide-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(28, 39, 57, 0.12);
}

.guide-card:active {
    transform: translateY(-2px) scale(0.99);
}

.guide-card-cta {
    display: inline-block;
    margin-top: auto;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.guide-card:hover .guide-card-cta,
.guide-card:focus-visible .guide-card-cta {
    transform: translateX(5px);
    color: var(--primary-dark);
}

.guide-card-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: #dde9f7;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
}

.guide-card h3 {
    margin: 2px 0 0;
    font-size: clamp(1.4rem, 1.2rem + 0.7vw, 2.05rem);
    line-height: 1.2;
}

.guide-card p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1.08rem, 0.95rem + 0.45vw, 1.6rem);
    line-height: 1.4;
}

.about-copy {
    text-align: center;
    color: var(--muted);
    max-width: 65ch;
    margin: 22px auto 0;
    font-size: clamp(1.1rem, 1rem + 0.8vw, 2.05rem);
    line-height: 1.45;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    width: fit-content;
}

.badge-popular { background: #fee2e2; color: #991b1b; }
.badge-cheapest { background: #dcfce7; color: #166534; }
.badge-city { background: #e0f2fe; color: #075985; }
.badge-beach { background: #fef3c7; color: #92400e; }

.guide-card.coming {
    opacity: 0.6;
    cursor: default;
}

.guide-card.coming:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.breadcrumb {
    display: block;
    margin: 0 0 24px 0;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--muted);
}

.breadcrumb li a {
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease-in-out;
}

.breadcrumb li a:active {
    transform: scale(0.98);
}

.breadcrumb li a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--border);
    font-weight: 400;
}

.breadcrumb li[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

header {
    display: none;
}

.article-layout {
    max-width: 980px;
    margin: 36px auto 24px;
    padding: 0 12px;
}

.card {
    background: #f4f6f9;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: clamp(24px, 2.4vw, 36px);
    margin-bottom: 24px;
}

.card h1 {
    margin: 0;
    font-size: clamp(1.8rem, 1.4rem + 1vw, 2.6rem);
}

.article-layout .card > img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    margin-bottom: 20px;
    aspect-ratio: 16 / 9;
}

.card h2 {
    margin-top: 26px;
    font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.9rem);
}

.card p,
.card li,
.card td {
    color: #384b67;
    font-size: clamp(1.06rem, 0.99rem + 0.3vw, 1.2rem);
}

.card table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.card thead tr {
    background-color: var(--primary);
    color: white;
}

.card th,
.card td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
    vertical-align: top;
}

.card tbody tr {
    transition: background-color 0.2s ease-in-out;
}

.card tbody tr:hover {
    background-color: rgba(10, 77, 163, 0.04);
}

.card td:first-child {
    font-weight: 600;
    color: var(--muted);
}

/* Quick Facts Table override */
section.card table td {
    border: none;
    border-bottom: 1px solid var(--border);
}

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

section.card table td:first-child {
    width: 40%;
    padding-left: 0;
}

section.card table td:last-child {
    padding-right: 0;
}

.card p a,
.card li a {
    color: var(--primary);
    text-decoration: underline;
    overflow-wrap: break-word;
    transition: color 0.2s ease-in-out;
}

.card p a:hover,
.card p a:focus-visible,
.card li a:hover,
.card li a:focus-visible {
    color: var(--primary-dark);
}

.reading-time {
    margin: 5px 0 15px;
    color: #555;
    font-size: 0.85em;
}

.quick-nav {
    margin: 2rem 0;
    padding: 1.25rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.quick-nav strong {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.quick-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.quick-nav a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
    color: var(--primary-dark);
}

.quick-nav a:active {
    transform: scale(0.98);
}

.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
    margin-top: 2rem;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--primary-dark);
    transform: translateX(-5px);
}

.back-link:active {
    transform: translateX(-5px) scale(0.98);
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 32px;
    padding: 30px 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--muted);
    font-size: 1.1rem;
}

.site-footer nav {
    display: flex;
    gap: 18px;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.site-footer a:active {
    transform: scale(0.98);
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text);
}

@media (max-width: 980px) {
    .guides-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-inner {
        padding: 16px 20px;
    }
}

@media (max-width: 680px) {
    :root {
        --scroll-padding: 180px;
    }

    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        gap: 4px 8px;
    }

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

    main {
        padding: 0 12px 48px;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
