/* Costa Verde: two-page tourism site about the coast of Asturias. */

/* Fonts are served from this site (no third-party requests). */
@font-face {
    font-family: "Yellowtail";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/yellowtail-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("../fonts/montserrat-latin-900-normal.woff2") format("woff2");
}

/* Fonts above: Yellowtail for the big titles, Montserrat for headings. */

:root {
    --bar: 3.6rem; /* height of the top bar */
    --sea: #2f7f7a;
    --sea-dark: #1f5c58;
    --sea-soft: #e4f1ef;
    --sand: #f7f4ee;
    --surface: #ffffff;
    --foam: #edf6f9;
    --text: #1b2626;
    --muted: #5c6b6a;
    --border: #e3e7e2;
    --radius: 16px;
    --shadow: 0 1px 2px rgb(27 38 38 / 0.06), 0 10px 30px rgb(27 38 38 / 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Keeps the sections the menu jumps to from hiding under the top bar. */
    scroll-padding-top: var(--bar);
}

body {
    margin: 0;
    background-color: var(--sand);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
}

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

a {
    color: var(--sea);
}

/* Top bar: sticks to the top while scrolling, slides in when the page loads. */
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: none; }
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgb(16 34 34 / 0.85);
    backdrop-filter: blur(10px);
    animation: slide-down 0.5s;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 2rem;
    width: min(70rem, 100% - 2.5rem);
    min-height: var(--bar);
    margin: 0 auto;
}

.brand {
    font-family: "Yellowtail", cursive;
    font-size: 1.7rem;
    color: white;
    text-decoration: none;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav ul a {
    color: rgb(255 255 255 / 0.85);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}

nav ul a:hover,
nav ul a:focus-visible {
    color: #9fd8d1;
}

/* Entrance: the photo fills the first screen and the title sits in the middle. */
@keyframes title-in {
    from { opacity: 0; transform: translateY(1.5rem); }
    to   { opacity: 1; transform: none; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(0.5rem); }
}

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100svh - var(--bar));
    padding: 2rem 1rem 5rem;
}

.hero > img {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Darkens the photo slightly so the title is always readable. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(0 0 0 / 0.2);
}

.hero h1 {
    margin: 0;
    font-family: "Yellowtail", cursive;
    font-weight: 400;
    font-size: clamp(3.5rem, 1rem + 9vw, 10rem);
    line-height: 1.1;
    text-align: center;
    color: var(--foam);
    text-decoration: underline;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.12em;
    text-shadow: 0.04em 0.04em 0.06em black;
    animation: title-in 1.2s ease-out;
}

.scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin-left: -1.5rem;
    color: var(--foam);
    filter: drop-shadow(0 0 4px black);
    animation: bounce 1.6s ease-in-out infinite;
}

.scroll-hint svg,
.to-top svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Content sections */
.section {
    padding: 5rem max(1.25rem, (100% - 70rem) / 2);
}

.section.tinted {
    background-color: var(--sea-soft);
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--sea);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h2,
h3 {
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
}

h3 {
    margin: 2.5rem 0 0.8rem;
    font-size: 1.2rem;
}

.split h3:first-child {
    margin-top: 0;
}

.spaced {
    margin-top: 4rem;
}

p {
    margin: 0 0 1em;
}

.lead {
    font-size: 1.2rem;
    color: var(--muted);
}

/* Text beside a photo; the photo goes first on narrow screens. */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
}

.split + .split {
    margin-top: 4rem;
}

.split.reverse > :first-child {
    order: 2;
}

figure {
    margin: 0;
}

figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

figcaption {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Key numbers */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
    margin: 3rem 0 1rem;
    padding: 0;
    list-style: none;
}

.facts li {
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    box-shadow: var(--shadow);
}

.facts strong {
    display: block;
    color: var(--sea);
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 900;
    font-size: 2.2rem;
    line-height: 1.1;
}

.facts span {
    color: var(--muted);
}

.note {
    color: var(--muted);
    font-style: italic;
}

/* Beaches */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--surface);
    font-weight: 600;
}

.chips span {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.callout {
    margin-top: 2.5rem;
    padding: 1.6rem 1.8rem;
    border-left: 5px solid var(--sea);
    border-radius: var(--radius);
    background-color: var(--surface);
    box-shadow: var(--shadow);
}

.callout h3 {
    margin-top: 0;
}

.callout p {
    margin: 0;
}

/* "Don't miss" cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cards li {
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--border);
    border-top: 4px solid var(--sea);
    border-radius: var(--radius);
    background-color: var(--surface);
    box-shadow: var(--shadow);
}

.cards h3 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
}

.cards p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    background-color: var(--sea);
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button:hover,
.button:focus-visible {
    background-color: var(--sea-dark);
}

/* Floating "back to top" button */
.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 90;
    width: 3rem;
    height: 3rem;
    padding: 0.6rem;
    border-radius: 50%;
    background-color: var(--sea);
    color: white;
    box-shadow: var(--shadow);
    transition: background-color 0.2s, transform 0.2s;
}

.to-top:hover,
.to-top:focus-visible {
    background-color: var(--sea-dark);
    transform: translateY(-2px);
}

footer {
    padding: 2rem 1.25rem;
    background-color: #102222;
    color: rgb(255 255 255 / 0.75);
    font-size: 0.9rem;
    text-align: center;
}

footer p {
    margin: 0.2rem 0;
}

footer strong {
    color: white;
}

footer a {
    color: inherit;
}

@media (max-width: 820px) {
    .section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

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

    .split > figure,
    .split.reverse > figure {
        order: -1;
    }

    .split.reverse > :first-child {
        order: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    header,
    .hero h1,
    .scroll-hint {
        animation: none;
    }
}
