@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Capri Eventi - Soft Mediterranean palette */
    --background: 0 0% 100%;
    --foreground: 220 15% 20%;

    --card: 0 0% 100%;
    --card-foreground: 220 15% 20%;

    --primary: 200 35% 45%;
    --foreground-primary: 0 0% 100%;

    --secondary: 40 10% 96%;
    --secondary-foreground: 220 15% 20%;

    --muted: 40 10% 96%;
    --muted-foreground: 220 10% 50%;

    --accent: 200 35% 45%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 220 10% 88%;
    --input: 220 10% 88%;
    --ring: 200 35% 45%;

    --category: 200 35% 45%;
    --meta: 220 10% 55%;
    --divider: 220 10% 90%;

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Layout Components --- */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.newsletter-container {
    margin: 0 auto;
    max-width: 42rem;
    padding: 2rem 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .newsletter-container {
        padding: 3rem 2rem;
    }
}

/* --- Header Section --- */

.header-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .header-section {
        margin-bottom: 3rem;
    }
}

.header-logo {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem;
}

@media (min-width: 768px) {
    .header-logo {
        width: 8rem;
        height: 8rem;
    }
}

.main-title {
    font-size: 1.875rem;
    /* text-3xl */
    line-height: 2.25rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    /* tracking-tight */
    font-weight: 600;
    /* font-semibold */
}

@media (min-width: 768px) {
    .main-title {
        font-size: 2.25rem;
        /* text-4xl */
        line-height: 2.5rem;
    }
}

.subtitle {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

@media (min-width: 768px) {
    .subtitle {
        font-size: 1.125rem;
    }
}

.date-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.intro-text {
    text-align: center;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    font-size: 0.875rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* --- Content Sections --- */

.section-divider {
    margin: 2rem 0;
    height: 1px;
    width: 100%;
    background-color: hsl(var(--divider));
}

@media (min-width: 768px) {
    .section-divider {
        margin: 2.5rem 0;
    }
}

.section-title {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
    color: hsl(var(--foreground));
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* --- Event Card --- */

.event-card {
    padding: 1.25rem 0;
    border-bottom: 1px solid hsl(var(--divider));
    animation: fade-in 0.5s ease-out forwards;
    opacity: 0;
    /* Starts hidden for animation */
}

/* Adjust animation delays for cascading effect */
.event-card:nth-child(1) {
    animation-delay: 0.1s;
}

.event-card:nth-child(2) {
    animation-delay: 0.2s;
}

.event-card:nth-child(3) {
    animation-delay: 0.3s;
}

.event-card:nth-child(4) {
    animation-delay: 0.4s;
}

.event-card:nth-child(5) {
    animation-delay: 0.5s;
}

.event-card:nth-child(6) {
    animation-delay: 0.6s;
}

.event-card:nth-child(7) {
    animation-delay: 0.7s;
}

.event-card:last-child {
    border-bottom: none;
}

@media (min-width: 768px) {
    .event-card {
        padding: 1.5rem 0;
    }
}

.category-label {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: hsl(var(--category));
    margin-bottom: 0.375rem;
}

.event-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    /* text-xl */
    line-height: 1.75rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-top: 0.375rem;
    /* mt-1.5 */
}

@media (min-width: 768px) {
    .event-title {
        font-size: 1.5rem;
        /* text-2xl */
        line-height: 2rem;
    }
}

.event-details {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}

.event-description {
    font-size: 0.875rem;
    /* text-sm */
    line-height: 1.625;
    /* leading-relaxed */
    color: hsl(var(--foreground));
    margin-top: 0.75rem;
    /* mt-3 space from meta */
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .event-description {
        font-size: 1rem;
        /* text-base on desktop */
    }
}

.event-meta {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: hsl(var(--meta));
}

.event-meta:first-of-type {
    margin-top: 0.5rem;
    /* mt-2 space from title */
}

.link-text {
    color: hsl(var(--primary));
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 150ms;
}

.link-text:hover {
    color: hsl(var(--primary) / 0.8);
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    border-top: 1px solid hsl(var(--divider));
    margin-top: 2rem;
}

/* --- Animations --- */

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}