/* ==========================================================
   Wave Dude page – comic / surf style
   Only used by wavedude_en.html. Header + footer keep the
   regular site style from huygensoptics.css.
   ========================================================== */

:root {
    --wd-ink: #111;
    --wd-ocean-deep: #08306b;
    --wd-ocean: #0b5cc2;
    --wd-cyan: #29b6e8;
    --wd-foam: #f4fbff;
    --wd-yellow: #ffd21f;
    --wd-orange: #ff7a1a;
    --wd-red: #e8361c;
    --wd-skin: #f6c79a;
}

/* Page background behind the panels: ocean with halftone dots */
.wd-page {
    background-color: var(--wd-ocean);
    background-image:
        radial-gradient(rgba(255,255,255,0.18) 1.4px, transparent 1.6px),
        linear-gradient(180deg, var(--wd-cyan) 0%, var(--wd-ocean) 45%, var(--wd-ocean-deep) 100%);
    background-size: 12px 12px, 100% 100%;
}

.wd-page main { margin-bottom: 0; }

/* Comic display font for headings */
.wd-title,
.wd-panel h2,
.wd-card h3,
.wd-btn,
.wd-badge,
.wd-bubble {
    font-family: 'Bangers', 'Impact', 'Arial Black', sans-serif;
    letter-spacing: 1px;
    font-weight: normal;
}

/* ---------- Generic comic panel ---------- */
.wd-panel {
    background: var(--wd-foam);
    border: 4px solid var(--wd-ink);
    border-radius: 6px;
    box-shadow: 8px 8px 0 var(--wd-ink);
    padding: 20px;
    margin-bottom: 36px;
}

.wd-panel h2 {
    display: inline-block;
    font-size: 2.1rem;
    line-height: 1;
    color: var(--wd-ink);
    background: var(--wd-yellow);
    border: 3px solid var(--wd-ink);
    padding: 6px 14px 4px;
    margin: -38px 0 14px -6px;
    transform: rotate(-2deg);
    box-shadow: 4px 4px 0 var(--wd-ink);
}

.wd-panel p { margin-bottom: 0.8em; }

/* Feature lists in the download sections */
.wd-features {
    padding-left: 2.5em;
    margin-bottom: 0.8em;
}

/* ---------- Hero ---------- */
.wd-hero {
    display: flex;
    gap: 24px;
    align-items: stretch;
    valign: top;
    padding: 0;
    overflow: hidden;
    background:
        repeating-conic-gradient(from 0deg at 30% 60%, rgba(255,255,255,0.10) 0deg 6deg, transparent 6deg 14deg),
        linear-gradient(135deg, var(--wd-cyan), var(--wd-ocean));
}

.wd-hero-img {
    flex: 1 1 250px;
    border-right: 4px solid var(--wd-ink);
    min-width: 0;
}

.wd-hero-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wd-hero-text {
    flex: 1 1 55%;
    padding: 28px 28px 28px 8px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.wd-title {
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    line-height: 0.9;
    color: var(--wd-yellow);
    -webkit-text-stroke: 3px var(--wd-ink);
    text-shadow: 5px 5px 0 var(--wd-red), 9px 9px 0 var(--wd-ink);
    transform: rotate(-3deg);
    margin-bottom: 18px;
}

.wd-tagline {
    font-size: 1.15rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 var(--wd-ink);
    margin-bottom: 18px;
}

/* Speech bubble */
.wd-bubble {
    position: relative;
    align-self: flex-start;
    background: white;
    color: var(--wd-ink);
    border: 3px solid var(--wd-ink);
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 1.35rem;
    margin-bottom: 22px;
    box-shadow: 4px 4px 0 var(--wd-ink);
}

.wd-bubble::before {           /* tail pointing towards the dude */
    content: "";
    position: absolute;
    left: -22px;
    top: 14px;
    border-width: 10px 22px 10px 0;
    border-style: solid;
    border-color: transparent var(--wd-ink) transparent transparent;
}

.wd-bubble::after {
    content: "";
    position: absolute;
    left: -15px;
    top: 17px;
    border-width: 7px 16px 7px 0;
    border-style: solid;
    border-color: transparent white transparent transparent;
}

.wd-hero-text .wd-intro {
    background: rgba(8, 48, 107, 0.55);
    border-left: 5px solid var(--wd-yellow);
    padding: 10px 14px;
    margin-bottom: 20px;
}

/* ---------- Buttons ---------- */
.wd-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

a.wd-btn,
a.wd-btn:link,
a.wd-btn:visited {
    display: inline-block;
    font-size: 1.3rem;
    color: var(--wd-ink);
    background: var(--wd-yellow);
    border: 3px solid var(--wd-ink);
    border-radius: 6px;
    padding: 8px 16px 6px;
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--wd-ink);
    transition: transform 0.1s, box-shadow 0.1s;
}

a.wd-btn:hover {
    color: var(--wd-ink);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--wd-ink);
}

a.wd-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--wd-ink);
}

a.wd-btn.wd-btn-alt { background: white; }
a.wd-btn.wd-btn-red { background: var(--wd-orange); }
a.wd-btn.wd-btn-small { font-size: 1.05rem; padding: 5px 12px 3px; box-shadow: 3px 3px 0 var(--wd-ink); }

/* ---------- Badges ---------- */
.wd-badge {
    display: inline-block;
    font-size: 0.95rem;
    border: 2px solid var(--wd-ink);
    border-radius: 4px;
    padding: 1px 8px 0;
    margin-right: 6px;
    background: white;
    color: var(--wd-ink);
    vertical-align: middle;
}

.wd-badge.latest { background: var(--wd-red); color: white; }
.wd-badge.pre    { background: var(--wd-orange); }
.wd-badge.stable { background: #7bd96b; }
.wd-badge.github { background: var(--wd-ink); color: white; }
.wd-badge.local  { background: var(--wd-cyan); }

/* ---------- Downloads list ---------- */
.wd-downloads {
    list-style: none;
}

.wd-download {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 3px dashed rgba(17,17,17,0.25);
}

.wd-download:last-child { border-bottom: none; }

.wd-download-icon {
    flex: 0 0 56px;
    height: 56px;
    border: 3px solid var(--wd-ink);
    border-radius: 50%;
    background: var(--wd-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 3px 3px 0 var(--wd-ink);
}

.wd-download-info { flex: 1; min-width: 0; }

.wd-download-info strong { display: block; font-size: 1.1rem; margin-top: 4px; }

.wd-download-info .wd-meta {
    font-size: 0.9rem;
    color: #444;
    margin: 2px 0 0;
}

.wd-download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Examples grid ---------- */
.wd-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.wd-filter button {
    font-family: 'Bangers', 'Impact', sans-serif;
    letter-spacing: 1px;
    font-size: 1.05rem;
    border: 2px solid var(--wd-ink);
    border-radius: 20px;
    padding: 4px 14px 2px;
    background: white;
    cursor: pointer;
}

.wd-filter button.active { background: var(--wd-ink); color: var(--wd-yellow); }

.wd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.wd-card {
    background: white;
    border: 3px solid var(--wd-ink);
    border-radius: 6px;
    box-shadow: 5px 5px 0 var(--wd-ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s;
}

.wd-card:hover { transform: rotate(-1deg) translateY(-3px); }

.wd-thumb {
    position: relative;
    display: block;
    border-bottom: 3px solid var(--wd-ink);
    aspect-ratio: 3 / 2;
    background: var(--wd-ocean-deep);
}

.wd-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wd-thumb .wd-badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

.wd-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wd-card h3 {
    font-size: 1.45rem;
    line-height: 1.05;
    margin-bottom: 6px;
    color: var(--wd-ocean-deep);
}

.wd-card p {
    font-size: 0.92rem;
    margin-bottom: 10px;
    flex: 1;
}

.wd-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
    color: #555;
}

.wd-card-foot code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ---------- Steps ---------- */
.wd-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    counter-reset: step;
    list-style: none;
}

.wd-steps li {
    position: relative;
    background: white;
    border: 3px solid var(--wd-ink);
    border-radius: 6px;
    padding: 30px 14px 14px;
    margin-top: 14px;
}

.wd-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -20px;
    left: 12px;
    width: 40px;
    height: 40px;
    border: 3px solid var(--wd-ink);
    border-radius: 50%;
    background: var(--wd-red);
    color: white;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Keep the site's "direct links" grid readable on the blue background */
.wd-page .grid-item { border: 3px solid var(--wd-ink); background: var(--wd-foam); }
.wd-page .wd-direct-title {
    text-align: center;
    color: white;
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 1px;
    text-shadow: 3px 3px 0 var(--wd-ink);
    margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .wd-panel.wd-hero { flex-direction: column; gap: 0; padding: 0; }
    .wd-hero-img { border-right: none; border-bottom: 4px solid var(--wd-ink); }
    .wd-hero-img img { max-height: 420px; object-position: center 20%; }
    .wd-hero-text { padding: 22px 18px; }
    .wd-bubble::before, .wd-bubble::after { display: none; }

    .wd-panel { box-shadow: 5px 5px 0 var(--wd-ink); padding: 16px; }
    .wd-panel h2 { font-size: 1.7rem; }

    .wd-download { flex-wrap: wrap; }
    .wd-download-icon { flex-basis: 44px; height: 44px; font-size: 1.2rem; }
    .wd-download-actions { width: 100%; justify-content: flex-start; }

    .wd-steps { grid-template-columns: 1fr; }
    .wd-title { font-size: 4rem; }
    .wd-hero-text .wd-btn-row a.wd-btn { font-size: 1.15rem; }
}

/* ---------- Click-to-zoom screenshots (real pixel size, scrollable) ---------- */
.wd-zoomable { cursor: zoom-in; }

.wd-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    overflow: auto;
    cursor: grab;
}

.wd-zoom-overlay.open { display: flex; }
.wd-zoom-overlay.dragging { cursor: grabbing; }

.wd-zoom-overlay img {
    margin: auto;            /* centres when smaller than the window, scrolls when larger */
    flex: none;
    max-width: none;
    max-height: none;
    image-rendering: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* ---------- Footer link: same colour as the footer text, glows on hover ---------- */
footer a,
footer a:link,
footer a:visited {
    color: inherit;
    text-decoration: none;
    transition: text-shadow 0.2s;
}

footer a:hover {
    color: inherit;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 14px rgba(41, 182, 232, 0.6);
}
