/* =================================================================
   Digital Green Snow White - Theme Styles
   Erasmus+ IDEA project landing page
   Brand: #e01a0f - Font: Nunito
   ================================================================= */

:root {
    --dgsw-brand:        #e01a0f;
    --dgsw-brand-dark:   #b41209;
    --dgsw-ink:          #1a3a6b;        /* deep navy for headings (matches slide deck) */
    --dgsw-text:         #1f2733;
    --dgsw-muted:        #5a6573;
    --dgsw-bg:           #ffffff;
    --dgsw-bg-alt:       #f8f9fb;
    --dgsw-hero-blue:    #d9ecf8;
    --dgsw-hero-blue-2:  #bcd9ee;
    --dgsw-border:       #e5e9ef;
    --dgsw-radius:       14px;
    --dgsw-radius-lg:    22px;
    --dgsw-shadow:       0 6px 24px rgba(26, 58, 107, 0.08);
    --dgsw-shadow-lg:    0 18px 50px rgba(26, 58, 107, 0.15);
    --dgsw-max:          1180px;
    --dgsw-gutter:       clamp(20px, 4vw, 48px);
}

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

html { scroll-behavior: smooth; }

body.dgsw-body {
    margin: 0;
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--dgsw-text);
    background: var(--dgsw-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--dgsw-brand); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--dgsw-brand-dark); }

h1, h2, h3 { font-family: inherit; color: var(--dgsw-ink); margin: 0 0 .6em; line-height: 1.18; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

::selection { background: var(--dgsw-brand); color: #fff; }

/* ----------- Layout ----------- */
.dgsw-container {
    max-width: var(--dgsw-max);
    margin: 0 auto;
    padding-left: var(--dgsw-gutter);
    padding-right: var(--dgsw-gutter);
}

.dgsw-section {
    padding: clamp(48px, 7vw, 96px) 0;
}

.dgsw-section__title {
    font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: clamp(28px, 4vw, 48px);
    position: relative;
    padding-bottom: 14px;
}
.dgsw-section__title::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 64px; height: 4px;
    background: var(--dgsw-brand);
    border-radius: 4px;
}

/* ----------- Skip link / Accessibility ----------- */
.dgsw-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #fff;
    color: var(--dgsw-brand);
    padding: 10px 16px;
    border-radius: 6px;
    z-index: 9999;
    font-weight: 700;
}
.dgsw-skip-link:focus { top: 16px; }

/* ----------- Site header ----------- */
.dgsw-site-header {
    background: #fff;
    border-bottom: 1px solid var(--dgsw-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
}
.dgsw-site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    min-height: 64px;
}
.dgsw-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--dgsw-ink);
    font-weight: 800;
    text-decoration: none;
}
.dgsw-site-brand .custom-logo { max-height: 48px; width: auto; }
.dgsw-site-brand__text { font-size: 1rem; }
.dgsw-site-tag {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--dgsw-brand);
    padding: 6px 12px;
    background: rgba(224, 26, 15, 0.08);
    border-radius: 999px;
}

/* =================================================================
   1. HERO
   ================================================================= */
.dgsw-hero {
    position: relative;
    overflow: hidden;
    padding-top: clamp(40px, 6vw, 80px);
    padding-bottom: clamp(56px, 8vw, 120px);
    text-align: center;
    isolation: isolate;
}

/* Subtle geometric polygon pattern (matches the project slide deck). */
.dgsw-hero__pattern {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .55;
    background-color: transparent;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 50%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600' preserveAspectRatio='xMidYMid slice'><g fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.6'><polygon points='0,0 220,90 90,260' fill='%23ffffff' fill-opacity='0.18'/><polygon points='220,90 380,40 380,260' fill='%23ffffff' fill-opacity='0.10'/><polygon points='90,260 220,90 380,260 240,420' fill='%23ffffff' fill-opacity='0.22'/><polygon points='380,40 560,120 380,260' fill='%23ffffff' fill-opacity='0.14'/><polygon points='380,260 560,120 620,300' fill='%23ffffff' fill-opacity='0.08'/><polygon points='560,120 800,60 800,260 620,300' fill='%23ffffff' fill-opacity='0.20'/><polygon points='240,420 380,260 620,300 540,560' fill='%23ffffff' fill-opacity='0.10'/><polygon points='540,560 620,300 800,260 800,600' fill='%23ffffff' fill-opacity='0.18'/><polygon points='0,0 0,300 90,260' fill='%23ffffff' fill-opacity='0.10'/><polygon points='0,300 240,420 90,260' fill='%23ffffff' fill-opacity='0.16'/><polygon points='0,300 240,420 0,600' fill='%23ffffff' fill-opacity='0.08'/><polygon points='0,600 240,420 540,560' fill='%23ffffff' fill-opacity='0.16'/></g></svg>");
    background-size: cover;
    background-position: center;
}

.dgsw-hero__inner {
    position: relative;
    z-index: 1;
}

.dgsw-hero__title {
    font-size: clamp(2rem, 1.2rem + 4vw, 3.75rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--dgsw-ink);
    margin: 32px auto 18px;
    max-width: 14ch;
    text-shadow: 0 1px 0 rgba(255,255,255,.4);
}

.dgsw-hero__subtitle {
    font-size: clamp(.95rem, .85rem + .4vw, 1.15rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dgsw-ink);
    max-width: 62ch;
    margin: 0 auto;
    letter-spacing: .04em;
    opacity: .85;
}

/* Bunting / flags */
.dgsw-bunting {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 8px;
}
.dgsw-bunting__rope {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 60px;
    top: 0;
}
.dgsw-flags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 28px);
    position: relative;
}
.dgsw-flag-item {
    transform: translateY(8px);
    animation: dgsw-sway 4.5s ease-in-out infinite;
}
.dgsw-flag-item:nth-child(2) { animation-delay: .3s; }
.dgsw-flag-item:nth-child(3) { animation-delay: .6s; }
.dgsw-flag-item:nth-child(4) { animation-delay: .9s; }
.dgsw-flag-item:nth-child(5) { animation-delay: 1.2s; }

.dgsw-flag {
    display: inline-block;
    font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem);
    line-height: 1;
    filter: drop-shadow(0 6px 12px rgba(26, 58, 107, 0.28));
    transform-origin: top center;
}
/* When a flag image is uploaded, render it as a proper pendant. */
img.dgsw-flag {
    width: clamp(36px, 4vw + 12px, 64px);
    height: auto;
    aspect-ratio: 100 / 140;
    object-fit: contain;
    font-size: 0; /* hide any alt text spacing */
}

@keyframes dgsw-sway {
    0%, 100% { transform: rotate(-3deg) translateY(8px); }
    50%      { transform: rotate( 3deg) translateY(8px); }
}

/* =================================================================
   2. LEARNING OUTCOMES
   ================================================================= */
.dgsw-outcomes { background: var(--dgsw-bg); }

.dgsw-outcomes__list {
    list-style: none;
    counter-reset: dgsw-outcome;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dgsw-outcome {
    counter-increment: dgsw-outcome;
    background: #fff;
    border: 1px solid var(--dgsw-border);
    border-radius: var(--dgsw-radius-lg);
    padding: 28px 26px 26px;
    position: relative;
    box-shadow: var(--dgsw-shadow);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.dgsw-outcome::before {
    content: counter(dgsw-outcome, decimal-leading-zero);
    position: absolute;
    top: 18px; right: 22px;
    font-weight: 900;
    font-size: 2.2rem;
    color: rgba(26, 58, 107, 0.08);
    line-height: 1;
}
.dgsw-outcome:hover {
    transform: translateY(-4px);
    box-shadow: var(--dgsw-shadow-lg);
    border-color: rgba(224, 26, 15, 0.25);
}
.dgsw-outcome__icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff, #fef1f0);
    border: 1px solid rgba(224, 26, 15, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: var(--dgsw-brand);
    font-weight: 800;
    overflow: hidden;
}
.dgsw-outcome__icon img.dgsw-icon-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}
.dgsw-outcome__text {
    font-size: 1.02rem;
    color: var(--dgsw-text);
    font-weight: 600;
    margin: 0;
}

/* =================================================================
   3. STORY INTRODUCTION
   ================================================================= */
.dgsw-story { background: var(--dgsw-bg-alt); }
.dgsw-story__inner { max-width: 820px; margin: 0 auto; }
.dgsw-story__text p {
    font-size: 1.08rem;
    color: var(--dgsw-text);
    margin-bottom: 1.1em;
}
.dgsw-story__text p:first-of-type::first-letter {
    font-size: 3rem;
    font-weight: 900;
    color: var(--dgsw-brand);
    float: left;
    line-height: 1;
    padding: 4px 10px 0 0;
}

/* =================================================================
   4. VIDEO LESSON
   ================================================================= */
.dgsw-video { background: var(--dgsw-bg); }
.dgsw-video__wrap {
    position: relative;
    border-radius: var(--dgsw-radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: var(--dgsw-shadow-lg);
    aspect-ratio: 16 / 9;
}
.dgsw-video__player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
    border: 0;
}
.dgsw-video__wrap--yt { background: #000; }
.dgsw-video__placeholder {
    border: 2px dashed rgba(26, 58, 107, 0.25);
    background:
        repeating-linear-gradient(45deg, #f4f7fb 0 12px, #eef2f7 12px 24px);
    border-radius: var(--dgsw-radius-lg);
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dgsw-ink);
    text-align: center;
    padding: 24px;
}
.dgsw-video__placeholder-icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: var(--dgsw-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 16px;
    box-shadow: 0 14px 30px rgba(224, 26, 15, 0.3);
}
.dgsw-video__placeholder p {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

/* =================================================================
   5. CTA / Materials buttons
   ================================================================= */
.dgsw-cta { background: var(--dgsw-bg-alt); }
.dgsw-cta__buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.dgsw-btn {
    --dgsw-btn-bg: var(--dgsw-brand);
    flex: 1 1 280px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 28px;
    background: var(--dgsw-btn-bg);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(0,0,0,.15);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
    position: relative;
    overflow: hidden;
}
.dgsw-btn::after {
    content: "→";
    margin-left: 6px;
    transition: transform .25s ease;
    font-weight: 700;
}
.dgsw-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 22px 40px rgba(0,0,0,.22);
    filter: brightness(1.05);
}
.dgsw-btn:hover::after { transform: translateX(4px); }
.dgsw-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
.dgsw-btn__icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* =================================================================
   6. CLOSING MESSAGE
   ================================================================= */
.dgsw-closing {
    background:
        radial-gradient(1200px 400px at 20% 0%, rgba(255,255,255,.18), transparent 60%),
        linear-gradient(135deg, var(--dgsw-brand) 0%, var(--dgsw-brand-dark) 100%);
    color: #fff;
    text-align: center;
}
.dgsw-closing__inner { max-width: 820px; margin: 0 auto; }
.dgsw-closing__title {
    color: #fff;
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: .03em;
    margin-bottom: 28px;
    padding-bottom: 14px;
    position: relative;
    display: inline-block;
}
.dgsw-closing__title::after {
    content: "";
    position: absolute;
    left: 50%; transform: translateX(-50%);
    bottom: 0;
    width: 80px; height: 4px;
    background: rgba(255,255,255,.7);
    border-radius: 4px;
}
.dgsw-closing__text {
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.75;
}
.dgsw-closing__text p { margin-bottom: 1.1em; }
.dgsw-closing__text p:last-child { margin-bottom: 0; }

/* =================================================================
   7. FOOTER / PARTNERS
   ================================================================= */
.dgsw-footer {
    background: #0d1f3c;
    color: #d6dde9;
    padding: clamp(48px, 6vw, 80px) 0 28px;
}
.dgsw-footer__title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    text-align: center;
    margin-bottom: 36px;
}

.dgsw-partners {
    list-style: none;
    margin: 0 0 36px;
    padding: 0;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: stretch;
}
.dgsw-partner {}
.dgsw-partner__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    text-align: center;
    color: #fff;
    height: 100%;
    transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
a.dgsw-partner__inner:hover {
    background: rgba(255,255,255,0.10);
    transform: translateY(-3px);
    border-color: rgba(224, 26, 15, 0.5);
    color: #fff;
}
.dgsw-partner__logo {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dgsw-partner__logo img {
    max-height: 70px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: .9;
}
.dgsw-partner__placeholder {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--dgsw-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: .03em;
}
.dgsw-partner__name {
    font-size: .9rem;
    font-weight: 700;
    color: #d6dde9;
    line-height: 1.3;
}

.dgsw-footer__copy {
    text-align: center;
    margin: 0;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: .85rem;
    color: #98a4bb;
}

/* =================================================================
   Responsive tweaks
   ================================================================= */
@media (max-width: 720px) {
    body.dgsw-body { font-size: 16px; }
    .dgsw-site-tag { display: none; }
    .dgsw-cta__buttons { flex-direction: column; }
    .dgsw-btn { width: 100%; }
    .dgsw-outcome::before { font-size: 1.7rem; top: 14px; right: 18px; }
    .dgsw-flags { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print */
@media print {
    .dgsw-site-header, .dgsw-footer, .dgsw-cta { display: none; }
    .dgsw-section { padding: 20px 0; }
    .dgsw-closing { background: #fff !important; color: #000; }
    .dgsw-closing__title, .dgsw-closing__title::after { color: #000; background: #000; }
}
