:root {
    --yellow: #ffdc00;
    --green: #19a33b;
    --green-dark: #0d7f2c;
    --green-light: #49bd62;
    --ink: #111;
    --muted: #5f646a;
    --paper: #f3f4f5;
    --white: #fff;
    --line: #e5e7e9;
    --shadow: 0 18px 44px rgba(17, 24, 39, .12), 0 3px 10px rgba(17, 24, 39, .07);
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden
}

body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit
}

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

button,
a {
    touch-action: manipulation
}

/* =========================
   HERO
   ========================= */
.hero {
    position: relative;
    width: 100%;
    min-height: 620px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .16) 0 1px, transparent 1.6px) 0 0/16px 16px,
        linear-gradient(180deg, #ffe100 0%, #ffd900 100%);
}

.hero::before {
    content: "";
    position: absolute;
    right: 7%;
    top: 114px;
    width: 640px;
    height: 162px;
    opacity: .18;
    background: repeating-linear-gradient(-10deg, rgba(255, 255, 255, .96) 0 3px, transparent 3px 17px);
    transform: skewX(-16deg);
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 166px;
    z-index: 1;
    background: var(--paper);
    clip-path: polygon(0 84%, 100% 58%, 100% 100%, 0 100%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 72px));
    height: 620px;
    margin: 0 auto;
}

.brand-logo {
    position: absolute;
    top: 34px;
    z-index: 5;
}

.brand-logo.generalitat {
    left: 0px;
    width: 290px;
   
    height: 122px;
    object-fit: contain;
    object-position: left center;
}

.brand-logo.ecoembes {
    right: 0;
    width: 220px;
    height: 72px;
    object-fit: contain;
    object-position: right center;
}

.hero-claim {
    position: absolute;
    left: 7%;
    top: 80px;
    width: min(34%, 485px);
    z-index: 4;
}

.hero-runners {
    position: absolute;
    right: 14%;
    top: 18px;
    width: min(27%, 438px);
    z-index: 4;
    filter: contrast(1.08);
}

.recycle-mark {
    position: absolute;
    right: 3%;
    top: 104px;
    z-index: 3;
    font-size: 255px;
    line-height: 1;
    font-family: Arial, sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, .79);
    transform: rotate(-8deg);
    user-select: none;
    opacity: .5;
}

.dot-field {
    position: absolute;
    right: 8%;
    top: 118px;
    width: 440px;
    height: 300px;
    z-index: 2;
    opacity: .18;
    background-image: radial-gradient(#111 1.35px, transparent 1.5px);
    background-size: 11px 11px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 86%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 20%, #000 86%, transparent);
}

.menu-toggle {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    z-index: 8;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
    content: "";
    display: block;
    width: 17px;
    height: 2px;
    background: #fff;
    margin: 4px auto;
    border-radius: 9px;
}

.mobile-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 78px;
    z-index: 20;
    width: 230px;
    padding: 10px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.mobile-menu.is-open {
    display: block
}

.mobile-menu a,
.mobile-menu .menu-link {
    display: block;
    width: 100%;
    padding: 11px 13px;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: inherit;
}

.mobile-menu .menu-link {
    border: 0;
    background: transparent;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.mobile-menu a:hover,
.mobile-menu .menu-link:hover {
    background: #f1f2f3
}

/* =========================
   CONTENIDO
   ========================= */
.main-wrap {
    position: relative;
    z-index: 8;
    width: min(1180px, 100%);
    margin: -76px auto 0;
    padding: 0 32px 64px;
}

.featured {
    width: 242px;
    min-height: 200px;
    margin: 0 auto -86px;
    position: relative;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(73, 189, 98, .97), rgba(13, 127, 44, .99));
    box-shadow: 0 15px 34px rgba(10, 94, 34, .28);
    transition: transform .2s ease, box-shadow .2s ease;
}

.featured::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background:
        linear-gradient(to top, rgba(4, 90, 27, .20), transparent 70%),
        url("img/castellon.png") center bottom/cover no-repeat;
    opacity: .26;
}

.featured::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, .06), transparent 42%, rgba(0, 0, 0, .07));
}

.featured > * {
    position: relative;
    z-index: 2
}

.featured:hover,
.event-card:hover {
    transform: translateY(-3px);
}

.camera-circle {
    width: 46px;
    height: 46px;
    border: 1.5px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.camera-icon {
    width: 24px;
    height: 24px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
}

.featured small {
    font-size: 17px;
    line-height: 1.2
}

.featured strong {
    display: block;
    font-size: 29px;
    line-height: 1.05;
    margin: 3px 0
}

.featured time {
    font-size: 20px;
    font-weight: 700
}

.featured .arrow {
    font-size: 29px;
    line-height: 1;
    margin-top: 9px
}

.content-card {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 115px 62px 34px;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, .06);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.info-row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 22px;
}

.info-icon {
    width: 42px;
    height: 42px;
    border: 1.7px solid var(--green-dark);
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--green-dark);
}

.info-icon svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.info-row p {
    margin: 0;
    color: #222;
    font-size: 14px;
    line-height: 1.48;
}

.info-row strong {
    font-weight: 760
}

.closing-claim {
    margin: 25px 0 0;
    text-align: center;
    color: var(--green-dark);
    font-weight: 800;
    font-size: 14px;
    line-height: 1.35;
}

/* =========================
   BOTONES DE CARRERAS
   ========================= */
.events {
    width: min(930px, 100%);
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.event-card {
    min-height: 168px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 12px;
    background: linear-gradient(145deg, #39ba56 0%, #0b9632 54%, #087e2a 100%);
    box-shadow: 0 9px 19px rgba(13, 75, 29, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.event-art {
    position: absolute;
    z-index: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center bottom;
    opacity: .26;
    pointer-events: none;
}

.event-card::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(to bottom, rgba(41, 181, 78, .34) 0%, rgba(27, 166, 62, .12) 43%, rgba(5, 111, 35, .08) 100%);
    pointer-events: none;
}

.event-inner {
    position: relative;
    z-index: 2;
    width: 100%
}

.event-camera {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
}

.event-camera svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
}

.event-card small {
    display: block;
    font-size: 12px;
    margin-bottom: 2px
}

.event-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.08
}

.event-card time {
    display: block;
    font-size: 13px;
    margin-top: 5px
}

.event-card .arrow {
    display: block;
    font-size: 23px;
    line-height: 1;
    margin-top: 6px
}

/* =========================
   FOOTER / COOKIES
   ========================= */
.site-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 190px;
    padding: 52px 18px 96px;
    text-align: center;
    color: #5b6066;
    font-size: 13px;
}

.site-footer::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image: url("img/footer-dots.svg");
    background-size: 120px 120px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .42) 24%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .42) 24%, #000 100%);
    opacity: .58;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}

.footer-links button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    text-decoration: none;
    font-weight: 700;
    color: #30343a;
    cursor: pointer;
}

.footer-links button:hover {
    text-decoration: underline
}

.footer-note {
    font-size: 12px;
    color: #7a7f85
}

.cookie-note {
    position: fixed;
    z-index: 100;
    left: 18px;
    right: 18px;
    bottom: 16px;
    max-width: 760px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    border: 1px solid #dedede;
    border-radius: 14px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .13);
    font-size: 13px;
    color: #50545a;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.cookie-note button {
    border: 0;
    border-radius: 9px;
    background: var(--green-dark);
    color: #fff;
    padding: 9px 13px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-note[hidden] {
    display: none
}

/* =========================
   MODALES LEGALES / IA
   ========================= */
.legal-dialog {
    width: min(760px, calc(100% - 32px));
    max-width: 760px;
    max-height: 84dvh;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.legal-dialog::backdrop {
    background: rgba(0, 0, 0, .56);
    backdrop-filter: blur(2px)
}

.dialog-shell {
    display: flex;
    flex-direction: column;
    max-height: 84dvh
}

.dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15
}

.dialog-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f0f2f3;
    color: #222;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.dialog-close:hover {
    background: #e6e8ea
}

.dialog-content {
    overflow: auto;
    padding: 22px 24px 28px;
    overscroll-behavior: contain
}

.dialog-content h3 {
    font-size: 17px;
    margin: 24px 0 8px
}

.dialog-content h3:first-of-type {
    margin-top: 10px
}

.dialog-content p,
.dialog-content li,
.dialog-content dd,
.dialog-content dt {
    font-size: 14px;
    line-height: 1.55
}

.dialog-content p {
    margin: 0 0 13px;
    color: #34383d
}

.dialog-content ul {
    padding-left: 20px
}

.dialog-content a {
    color: var(--green-dark);
    font-weight: 700
}

.reg-note {
    font-size: 13px !important;
    color: #656b72 !important
}

.inline-dialog-link {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--green-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.inline-dialog-link:hover {
    text-decoration: underline
}

.legal-data {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 18px;
    margin: 14px 0 20px;
}

.legal-data dt {
    font-weight: 800;
    color: #24282c
}

.legal-data dd {
    margin: 0;
    color: #454a50;
    overflow-wrap: anywhere
}

/* =========================
   TABLET <= 1024
   ========================= */
@media (max-width:1024px) {
    .hero {
        min-height: 570px
    }

    .hero-inner {
        height: 570px;
        width: min(100%, calc(100% - 44px))
    }

    .hero::before {
        right: 5%;
        top: 122px;
        width: 510px;
        height: 145px
    }

    .hero::after {
        height: 150px;
        clip-path: polygon(0 85%, 100% 61%, 100% 100%, 0 100%)
    }

    .brand-logo.generalitat {
        width: 202px;
        height: 126px
    }

    .brand-logo.ecoembes {
        width: 192px;
        height: 72px
    }

    .hero-claim {
       left: 5%;
        width: min(39%, 410px);
        top: 96px
    }

    .hero-runners {
        right: 11%;
        top: 52px;
        width: min(36%, 350px)
    }

    .recycle-mark {
        right: 0;
        top: 132px;
        font-size: 210px
    }

    .dot-field {
        right: 1%;
        top: 142px;
        width: 340px;
        height: 238px
    }

    .main-wrap {
        margin: -68px auto 0;
        padding: 0 24px 56px
    }

    .content-card {
        width: min(700px, 100%)
    }

    .events {
        gap: 12px
    }

    .event-card {
        min-height: 154px;
        padding: 16px 8px
    }

    .event-art {
        height: 100%
    }

    .event-card strong {
        font-size: 16px
    }
}

/* =========================
   MÓVIL <= 639
   ========================= */
@media (max-width:639px) {
    .hero {
        min-height: 498px
    }

    .hero-inner {
        height: 498px;
        width: calc(100% - 28px)
    }

    .hero::before {
        right: -2%;
        top: 134px;
        width: 255px;
        height: 118px;
        opacity: .15
    }

    .hero::after {
        height: 122px;
        clip-path: polygon(0 87%, 100% 67%, 100% 100%, 0 100%)
    }

    .brand-logo {
        top: 18px
    }

    .brand-logo.generalitat {
        left: 7%;
        width: 128px;
        height: 80px
    }

    .brand-logo.ecoembes {
        right: 48px;
        width: 148px;
        height: 56px
    }

    .menu-toggle {
        display: block;
        top: 18px
    }

    .hero-claim {
        left: 0;
        top: 94px;
        width: 58%
    }

    .hero-runners {
        right: -1%;
        top: 122px;
        width: 42%
    }

    .recycle-mark {
        right: -8%;
        top: 170px;
        font-size: 152px
    }

    .dot-field {
        right: -12%;
        top: 134px;
        width: 230px;
        height: 200px;
        opacity: .12
    }

    .main-wrap {
        margin: -54px auto 0;
        padding: 0 13px 44px
    }

    .featured {
        width: 194px;
        min-height: 166px;
        margin-bottom: -72px;
        border-radius: 15px;
    }

    .featured::before {
        height: 100%
    }

    .camera-circle {
        width: 39px;
        height: 39px;
        margin-bottom: 8px
    }

    .featured small {
        font-size: 14px
    }

    .featured strong {
        font-size: 25px
    }

    .featured time {
        font-size: 17px
    }

    .featured .arrow {
        font-size: 24px;
        margin-top: 7px
    }

    .content-card {
        padding: 102px 18px 24px;
        border-radius: 16px;
    }

    .info-row {
        grid-template-columns: 38px 1fr;
        gap: 12px;
        margin-bottom: 18px;
    }

    .info-icon {
        width: 36px;
        height: 36px
    }

    .info-icon svg {
        width: 20px;
        height: 20px
    }

    .info-row p {
        font-size: 12px;
        line-height: 1.43
    }

    .closing-claim {
        font-size: 12px;
        margin-top: 20px
    }

    .events {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 14px;
    }

    .event-card {
        min-height: 142px;
        padding: 13px 7px;
        border-radius: 10px;
    }

    .event-art {
        height: 100%
    }

    .event-card small {
        font-size: 10px
    }

    .event-card strong {
        font-size: 14px
    }

    .event-card time {
        font-size: 11px
    }

    .event-camera {
        width: 29px;
        height: 29px;
        margin-bottom: 6px
    }

    .event-card .arrow {
        font-size: 19px;
        margin-top: 4px
    }

    .site-footer {
        padding-bottom: 92px
    }

    .cookie-note {
        left: 9px;
        right: 9px;
        bottom: 9px;
        border-radius: 11px;
        font-size: 11px;
        padding: 9px 10px;
    }

    .cookie-note button {
        padding: 8px 10px
    }

    .legal-dialog {
        width: min(100%, calc(100% - 18px));
        max-height: 88dvh
    }

    .dialog-header {
        padding: 16px 16px 14px
    }

    .dialog-header h2 {
        font-size: 21px
    }

    .dialog-content {
        padding: 18px 16px 22px
    }

    .legal-data {
        grid-template-columns: 1fr;
        gap: 2px
    }

    .legal-data dd {
        margin-bottom: 10px
    }
}

@media (max-width:390px) {
    .brand-logo.generalitat {
        width: 116px
    }

    .brand-logo.ecoembes {
        width: 138px;
        right: 44px
    }

    .hero-claim {
        top: 102px;
        width: 60%
    }

    .hero-runners {
        top: 123px;
        width: 36%
    }

    .recycle-mark {
        top: 178px;
        font-size: 138px
    }

    .events {
        gap: 8px
    }

    .event-card {
        min-height: 136px;
        padding: 11px 6px
    }

    .event-card strong {
        font-size: 13px
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important
    }
}
