/* Gallery, error page, data-protection note and the ANAF form. Tokens come from theme.css. */

/* ===== gallery (album list and photos of an album share the same cards) ===== */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.2rem; }
.thumbnail {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.thumbnail:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.thumbnail .thumb-link { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--blue-100); }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.thumbnail:hover img { transform: scale(1.05); }
.thumbnail .caption:empty { display: none; }
.thumbnail .caption { padding: .8rem 1rem 1rem; font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--navy-900); }
.thumbnail .caption a { color: inherit; text-decoration: none; }
.thumbnail .caption a:hover, .thumbnail .caption a:focus-visible { color: var(--blue-600); text-decoration: underline; }
.back-link { margin: 1.6rem 0 0; }
@media (max-width: 479.98px) { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; } .thumbnail .caption { padding: .6rem .7rem .8rem; font-size: .88rem; } }
@media (prefers-reduced-motion: reduce) { .thumbnail, .thumbnail img { transition: none; } .thumbnail:hover { transform: none; } .thumbnail:hover img { transform: none; } }

/* lightbox in the colours of the site */
.fancybox__container { --fancybox-backdrop-bg: rgba(10, 18, 48, .94); --f-button-bg: rgba(255, 255, 255, .12); --f-button-hover-bg: rgba(255, 255, 255, .24); }

/* ===== error page ===== */
.error-page { max-width: 40rem; margin: 1rem auto; padding: clamp(1.6rem, 5vw, 3rem); text-align: center; }
.error-code {
    margin: 0;
    font-family: var(--font-display); font-weight: 700; line-height: 1;
    font-size: clamp(4.5rem, 3rem + 8vw, 8rem);
    background: linear-gradient(120deg, var(--navy-700), var(--blue-500));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page h1 { margin: .4rem 0 .6rem; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
.error-note { color: var(--muted); }
.error-page h2 { margin: 1.6rem 0 .8rem; font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; }
.error-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }

/* ===== data-protection note (long legal text) ===== */
.legal { max-width: 62rem; line-height: 1.75; }
.legal h2 { margin: 0 0 1rem; font-family: var(--font-body); font-size: 1.2rem; font-weight: 800; color: var(--navy-900); }
.legal h3 {
    margin: 2rem 0 .6rem; padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-body); font-size: .98rem; font-weight: 700; letter-spacing: .02em; color: var(--navy-700);
}

/* ===== ANAF form ===== */
#anaf_form .form-lead { max-width: 46rem; margin: 0 auto 1.8rem; text-align: center; font-size: 1.05rem; color: var(--muted); }
.form-card { min-width: 0; margin: 0 0 1.4rem; padding: 1.4rem 1.4rem .7rem; background: var(--blue-50); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.form-card legend { float: left; width: 100%; margin: 0 0 1rem; padding: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--navy-900); }
#anaf_form label { margin-bottom: .3rem; font-size: .92rem; font-weight: 600; color: var(--navy-900); }
#anaf_form .form-check-label { font-weight: 400; font-size: 1rem; }
#anaf_form .form-control, #anaf_form .form-select { padding: .6rem .8rem; border-color: #c5d2e2; border-radius: 10px; }
#anaf_form .form-control:focus, #anaf_form .form-select:focus { border-color: var(--blue-500); box-shadow: 0 0 0 .25rem rgba(63, 127, 176, .22); }
#anaf_form .form-check-input { width: 1.15em; height: 1.15em; margin-top: .2em; border-color: #8aa0bb; }
#anaf_form .form-check-input:checked { background-color: var(--blue-600); border-color: var(--blue-600); }
#anaf_form .form-check-input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 .25rem rgba(63, 127, 176, .22); }
label.required::after { content: ' *'; color: #b3261e; }
.error { margin-left: 5px; color: #b3261e !important; }

.signature-pad canvas {
    display: block;
    width: 100%; max-width: 440px;
    aspect-ratio: 2 / 1;
    background: #fff;
    border: 2px dashed var(--blue-300);
    border-radius: 12px;
    cursor: crosshair;
    touch-action: none;
}

/* ===== stored pages (admin-edited HTML): what the restyle command and the editor produce ===== */
.site-panel-body .acrostics { max-width: 38rem; margin: 1.5rem auto 2rem; }
.site-panel-body .ratio { max-width: 640px; margin: 0 auto 1.2rem; }
.site-panel-body .table-responsive { margin: 0 0 1.4rem; }
.site-panel-body table { font-size: .95rem; }
.site-panel-body table td, .site-panel-body table th { padding: .5rem .7rem; }
.site-panel-body video { max-width: 100%; height: auto; }
.site-panel-body h2 { margin-top: 2rem; }

/* ===== TV appearances (/management/promovare/): a section apart from the press list, videos on the same cards as the gallery ===== */
.tv-section { margin-top: 2.6rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.tv-section > h2 { margin: 1.6rem 0 1.4rem; }
.video-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
/* the iframe fills the card: no extra width limit or margin from the generic .ratio rule */
.video-grid .thumbnail .ratio { max-width: none; margin: 0; background: var(--blue-100); }
@media (max-width: 575.98px) { .video-grid { grid-template-columns: 1fr; } }

/* ===== the magazine page (/revista-scolii/): a description card, then one card per edition with its cover ===== */
.site-panel-body .info-card { margin: 0 0 2.2rem; padding: clamp(1.4rem, 3vw, 2.2rem); background: linear-gradient(160deg, var(--blue-50) 0%, var(--surface) 70%); }
.site-panel-body .info-card h2 { margin: 0 0 1.1rem; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.site-panel-body .info-card p { margin: 0 0 1rem; line-height: 1.75; }
.site-panel-body .info-card p:last-child { margin-bottom: 0; }
.magazine-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.4rem; }
/* an A4 cover: the whole page shows, the top first if a cover is a little wider */
.magazine-grid .thumbnail .thumb-link { aspect-ratio: 5 / 7; }
.magazine-grid .thumbnail img { object-position: top center; }
.magazine-grid .thumbnail .caption { padding: .9rem 1rem 1.1rem; font-size: .92rem; }
.magazine-note { display: block; margin-top: .4rem; font-size: .82rem; font-weight: 500; line-height: 1.4; color: var(--muted); }
@media (max-width: 479.98px) {
    /* two covers per row on a phone (this rule must come after the auto-fill one above) */
    .magazine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
    .magazine-grid .thumbnail .caption { padding: .6rem .7rem .8rem; font-size: .8rem; }
    .magazine-note { font-size: .74rem; }
}

/* ===== "Mai multe documente": the older part of a long stored page, folded behind a toggle (<details>, no script needed) ===== */
.site-panel-body details.more-docs { margin-top: 1.6rem; }
.more-docs > summary,
.more-docs-close-bottom {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .65rem 1.3rem;
    border: 1px solid var(--blue-300); border-radius: 999px;
    background: var(--blue-50); color: var(--blue-600);
    font: inherit; font-weight: 600; line-height: 1.2;
    cursor: pointer; list-style: none; user-select: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.more-docs > summary::-webkit-details-marker { display: none; }
.more-docs > summary::before,
.more-docs-close-bottom::before {
    content: ''; width: .55rem; height: .55rem; margin-top: -.2rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s ease;
}
.more-docs[open] > summary::before, .more-docs-close-bottom::before { transform: rotate(-135deg); margin-top: .2rem; }
.more-docs > summary:hover, .more-docs > summary:focus-visible,
.more-docs-close-bottom:hover, .more-docs-close-bottom:focus-visible { background: var(--blue-100); border-color: var(--blue-500); color: var(--navy-700); }
.more-docs > summary .more-docs-close { display: none; }
.more-docs[open] > summary .more-docs-open { display: none; }
.more-docs[open] > summary .more-docs-close { display: inline; }
.more-docs[open] > summary { margin-bottom: 1.4rem; }
.more-docs-close-bottom { margin-top: 1.6rem; }
@media (prefers-reduced-motion: reduce) { .more-docs > summary::before, .more-docs-close-bottom::before { transition: none; } }

/* ===== the ICDL page (/proiecte/ecdl/): an introduction card with the test centre logo, then the steps and the advantages ===== */
.site-panel-body .icdl-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; margin-bottom: 1.2rem; }
.site-panel-body .icdl-intro p { margin-bottom: 0; }
.icdl-intro img { width: 150px; height: auto; border-radius: 10px; box-shadow: var(--shadow-sm); }
.icdl-steps, .icdl-advantages { padding-left: 1.6rem; }
.icdl-steps > li, .icdl-advantages > li { margin-bottom: .7rem; line-height: 1.7; }
@media (max-width: 575.98px) {
    .site-panel-body .icdl-intro { grid-template-columns: 1fr; }
    .icdl-intro img { order: -1; width: 120px; }
}
