/* ==========================================================================
   Ανδρέας Παπαχρίστος — site stylesheet
   Mobile-first; the desktop layout starts at 760px.
   Visual language follows the original Joomla "blackwhite" template:
   light-gray header/footer bands, a dark gradient menu bar whose active item
   is a white tab, and an 800px content column.

   1. Tokens   2. Fonts   3. Base   4. Layout   5. Header   6. Navigation
   7. Footer   8. Components   9. Pages
   ========================================================================== */


/* 1. Tokens
   ========================================================================== */

:root {
    --color-text: #555;
    --color-heading: #4c4c4c;
    --color-muted: #888;
    --color-link: #005689;
    --color-band: #eee;           /* header & footer background */
    --color-surface: #fff;        /* content background */
    --color-border: #dedede;
    --color-quote-mark: #d8d8d8;
    --color-nav-top: #444;
    --color-nav-bottom: #111;
    --color-nav-text: #fff;
    --color-nav-hover: #222;
    --color-tab-border: #dcdcdc;

    --font-sans: "Open Sans", Arial, Helvetica, sans-serif;
    --font-serif: Georgia, "Times New Roman", Times, serif;

    --wrapper-width: 800px;
    --gutter: 16px;
    --shadow-photo: 3px 3px 1px #ccc;
}


/* 2. Fonts (self-hosted Open Sans, variable weight 400–700)
   ========================================================================== */

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/open-sans-greek.woff2") format("woff2");
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/open-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Open Sans";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/open-sans-italic-greek.woff2") format("woff2");
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
    font-family: "Open Sans";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/open-sans-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* 3. Base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--color-band);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.7;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-link);
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    color: var(--color-heading);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 1.6rem;
}

h2 {
    font-size: 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 8px 12px;
    background: var(--color-surface);
    translate: 0 -200%;

    &:focus {
        translate: 0;
    }
}


/* 4. Layout
   ========================================================================== */

.wrapper {
    width: min(100% - 2 * var(--gutter), var(--wrapper-width));
    margin-inline: auto;
}

.site-main {
    flex: 1;                      /* keeps the footer at the bottom on short pages */
    background: var(--color-surface);
    padding-block: 16px 40px;
}


/* 5. Header
   ========================================================================== */

.site-header {
    background: var(--color-band);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
    padding-top: 24px;
}

.site-logo {
    display: block;

    & img {
        display: block;
        width: 380px;
    }
}

/* The quote, framed by large typographic quote marks. */
.site-quote {
    position: relative;
    max-width: 400px;
    margin: 0;
    padding: 0 34px;
    color: var(--color-muted);
    font-family: var(--font-serif);
    font-size: 0.8125rem;
    line-height: 1.6;
    text-align: center;

    &::before,
    &::after {
        position: absolute;
        color: var(--color-quote-mark);
        font-size: 3rem;
        line-height: 1;
    }

    &::before {
        content: "\201C";
        top: -4px;
        left: 0;
    }

    &::after {
        content: "\201D";
        right: 0;
        bottom: -24px;
    }

    & p {
        margin: 0;
    }
}

.site-quote__author {
    font-size: 0.6875rem;
}

.language-switcher {
    position: absolute;
    top: 2px;
    right: 0;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;

    & a[aria-current] {
        color: var(--color-text);
        font-weight: 600;
    }
}

@media (min-width: 760px) {
    .site-header__inner {
        grid-template-columns: 1fr auto;
        align-items: start;
        justify-items: stretch;
        gap: 0 24px;
        padding-top: 0;
    }

    .site-logo {
        padding-top: 26px;
    }

    .site-quote {
        margin-top: 16px;
    }

    .language-switcher {
        right: 4px;
    }
}


/* 6. Navigation
   Mobile: a dark bar with a "Μενού" toggle that expands a vertical list.
   Desktop: the dark bar shows every item; the current page is a white tab
   that merges into the content area below.
   ========================================================================== */

.site-nav {
    justify-self: stretch;
    background: linear-gradient(var(--color-nav-top), var(--color-nav-bottom));
    margin-bottom: -1px;          /* cover the header's bottom border */
}

.site-nav__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: none;
    color: var(--color-nav-text);
    font: 600 1rem/1.4 var(--font-sans);
    text-shadow: 1px 1px 1px #000;
    cursor: pointer;
}

/* Three-bar icon that turns into an X when the menu is open. */
.site-nav__toggle-icon {
    position: relative;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: background-color 0.2s;

    &::before,
    &::after {
        content: "";
        position: absolute;
        left: 0;
        width: 20px;
        height: 2px;
        background: currentColor;
        transition: translate 0.2s, rotate 0.2s;
    }

    &::before {
        translate: 0 -6px;
    }

    &::after {
        translate: 0 6px;
    }

    [aria-expanded="true"] > & {
        background-color: transparent;

        &::before {
            translate: 0;
            rotate: 45deg;
        }

        &::after {
            translate: 0;
            rotate: -45deg;
        }
    }
}

.site-nav__menu {
    display: none;
    margin: 0;
    padding: 0 0 8px;
    list-style: none;

    [aria-expanded="true"] + & {
        display: block;
    }

    & a {
        display: block;
        padding: 10px 16px;
        border-top: 1px solid rgb(255 255 255 / 0.08);
        color: var(--color-nav-text);
        font-size: 1.0625rem;
        text-shadow: 1px 1px 1px #000;
        transition: background-color 0.3s linear, color 0.3s linear;

        &:hover {
            background: var(--color-nav-hover);
            text-decoration: none;
        }

        &[aria-current] {
            background: var(--color-surface);
            color: var(--color-text);
            text-shadow: none;
        }
    }
}

@media (min-width: 760px) {
    .site-nav {
        grid-column: 1 / -1;
        margin-top: 12px;
    }

    .site-nav__toggle {
        display: none;
    }

    .site-nav__menu {
        display: flex;
        flex-wrap: wrap;
        padding: 0;

        & a {
            padding: 10px 15px;
            border: 1px solid transparent;
            border-bottom: 0;
            font-size: 1.0625rem;

            &[aria-current] {
                border-color: var(--color-tab-border);
            }
        }
    }
}


/* 7. Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--color-border);
    color: #999;
    font-size: 0.8125rem;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-block: 12px 32px;
    text-align: center;
}

.site-footer__copyright {
    margin: 0;
}

.site-footer__credit img {
    display: block;
}

@media (min-width: 760px) {
    .site-footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;
    }
}


/* 8. Components
   ========================================================================== */

/* Notice: simple centered message (404 page). */
.notice {
    padding-block: 32px;
    text-align: center;
}

/* Section title: small bold heading, as on the old site. */
.section-title {
    margin: 0 0 1em;
    color: var(--color-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Prose: long-form text with floated figures (biography, …). */
.prose {
    display: flow-root;           /* contains the floats */

    & p {
        margin: 0 0 1em;
    }
}

/* A titled section, spaced from what comes before it. */
.prose-section {
    padding-top: 2.5em;
}

/* After a long text, the next section starts below any floated photo. */
.prose > .prose-section {
    clear: both;
}

/* Sections that flow beside a floated photo (exhibitions); contains the float. */
.sections {
    display: flow-root;

    & > .prose-section:first-of-type {
        padding-top: 0;
    }
}

.prose-quote {
    display: flow-root;           /* sits beside a float instead of under it */
    margin: 0 0 1em;
    padding-left: 16px;
    border-left: 3px solid var(--color-border);
    font-style: italic;

    & p {
        margin: 0;
    }
}

/* Figure: a photo with the old site's offset shadow. Centered on phones,
   floated beside the text from 600px up. */
.figure {
    width: fit-content;
    margin: 0 auto 20px;

    & img {
        display: block;
        box-shadow: var(--shadow-photo);
    }
}

@media (min-width: 600px) {
    .figure--left {
        float: left;
        margin: 4px 24px 16px 0;
    }

    .figure--right {
        float: right;
        margin: 4px 0 16px 24px;
    }
}

/* Timeline: a narrow year column with the description beside it. */
.timeline {
    margin: 0;
}

.timeline__item {
    display: grid;
    grid-template-columns: 4.5em 1fr;
    gap: 12px;
    padding-block: 4px;
}

.timeline__year {
    color: var(--color-heading);
    font-weight: 700;
}

.timeline__text {
    margin: 0;
}

/* Plain list: one item per line, no bullets. */
.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Page header of a sub-page: a link back to the parent, then the title. */
.page-header {
    margin-bottom: 16px;

    & .section-title {
        margin: 4px 0 0;
    }
}

.back-link::before {
    content: "‹ ";
}

/* Arrow button: a previous/next chevron over an image (slideshow, gallery, lightbox).
   The parent must be position: relative. */
.arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 64px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    opacity: 0.7;
    cursor: pointer;
    translate: 0 -50%;
    transition: opacity 0.3s;
    filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.35));

    & svg {
        width: 32px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }

    &:hover,
    &:focus-visible {
        opacity: 1;
    }
}

.arrow--prev {
    left: 4px;
}

.arrow--next {
    right: 4px;
}

/* Over the slideshow and the gallery image, arrows stay faint until the mouse is over it. */
@media (hover: hover) {
    :is(.slideshow, .gallery__frame) .arrow {
        opacity: 0.25;
    }

    :is(.slideshow, .gallery__frame):hover .arrow {
        opacity: 0.7;
    }

    :is(.slideshow, .gallery__frame) .arrow:is(:hover, :focus-visible) {
        opacity: 1;
    }
}

/* Slideshow: stacked slides that cross-fade (see assets/js/slideshow.js). */
.slideshow {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-band);
    touch-action: pan-y;          /* horizontal swipes go to the script */
    user-select: none;
}

.slideshow__slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 1.8s ease-in-out;

    &.is-active {
        opacity: 1;
    }

    & img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

.slideshow__dots {
    position: absolute;
    right: 8px;
    bottom: 10px;
    display: flex;
}

/* Progress line: fills over the slide interval and is the autoplay timer, as on the
   old site. The dark track keeps it visible over both the photo and the gray sides. */
.slideshow__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgb(0 0 0 / 0.45);
}

.slideshow__progress-bar {
    height: 100%;
    background: rgb(255 255 255 / 0.75);
    transform: scaleX(0);
    transform-origin: left;
}

/* 24px touch target around a 12px dot. */
.slideshow__dot {
    --dot-color: rgb(255 255 255 / 0.5);
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: radial-gradient(circle, var(--dot-color) 5px, transparent 6px);
    cursor: pointer;

    &[aria-current="true"],
    &:hover {
        --dot-color: #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slideshow__slide {
        transition: none;
    }
}

/* Series grid: the works catalog. Two per row on phones, three from 600px;
   an incomplete last row is centered, as on the old site. */
.series-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px 24px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;

    & > li {
        width: calc((100% - 24px) / 2);
    }
}

@media (min-width: 600px) {
    .series-grid > li {
        width: calc((100% - 2 * 24px) / 3);
    }
}

.series-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;    /* covers line up when a title wraps */
    align-items: center;
    gap: 8px;
    height: 100%;
    color: var(--color-heading);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;

    & img {
        display: block;
        width: 100%;
        max-width: 246px;
        box-shadow: var(--shadow-photo);
        transition: opacity 0.2s;
    }

    &:hover {
        text-decoration: none;

        & img {
            opacity: 0.85;
        }
    }
}

/* Gallery: dark panel with the current image, its caption and a thumbnail grid
   (see assets/js/gallery.js), following the old site's gallery. */
.gallery {
    padding: 8px;
    background: #333;
    color: #fff;

    & :focus-visible {
        outline-color: #fff;
    }
}

.gallery__stage {
    margin: 0;
}

.gallery__frame {
    position: relative;
    touch-action: pan-y;          /* horizontal swipes go to the script */
}

.gallery__main {
    display: block;
    background: var(--color-band);
    cursor: zoom-in;
}

.gallery__image {
    display: block;
    width: 100%;
    height: auto;
}

.gallery__caption {
    padding: 10px 4px 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.3;
}

.gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.gallery__thumb {
    display: block;
    padding: 3px;
    border: 3px solid #555;
    background: #fff;
    transition: border-color 0.2s;

    &:hover {
        border-color: #888;
    }

    &[aria-current] {
        border-color: #bbb;
    }

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

@media (min-width: 600px) {
    .gallery {
        padding: 16px;
    }

    .gallery__caption {
        font-size: 1.5rem;
    }

    .gallery__thumbs {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
}

/* Lightbox: a full-screen modal <dialog> showing one image (see assets/js/lightbox.js). */
.lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 56px 8px;
    border: 0;
    background: rgb(17 17 17 / 0.97);
    color: #fff;
    touch-action: pan-y;

    &[open] {
        display: grid;
        place-items: center;
    }

    &::backdrop {
        background: transparent;
    }

    & :focus-visible {
        outline-color: #fff;
    }
}

html:has(.lightbox[open]) {
    overflow: hidden;             /* no page scrolling behind the open lightbox */
}

.lightbox__figure {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 0;
}

.lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 160px);
    width: auto;
    height: auto;
}

.lightbox__caption {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    text-align: center;
}

.lightbox__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;

    & svg {
        width: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }
}

@media (min-width: 760px) {
    .lightbox {
        padding-inline: 64px;
    }
}


/* Button: dark like the menu bar; --secondary is light and outlined. */
.button {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #222;
    background: linear-gradient(var(--color-nav-top), var(--color-nav-bottom));
    color: var(--color-nav-text);
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 1px 1px 1px #000;

    &:hover {
        background: var(--color-nav-hover);
        text-decoration: none;
    }
}

.button--secondary {
    border-color: #bbb;
    background: var(--color-surface);
    color: var(--color-text);
    text-shadow: none;

    &:hover {
        background: var(--color-band);
    }
}

/* Book list: each book's text beside its photos; on phones the text comes first. */
.book-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.book {
    display: grid;
    gap: 16px;
    padding-block: 28px;
    border-top: 1px solid var(--color-border);

    &:first-child {
        padding-top: 0;
        border-top: 0;
    }
}

.book__title {
    margin: 0 0 6px;
    font-size: 1.125rem;
}

.book__details {
    margin: 0 0 14px;
}

.book__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.book__meta {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

.book__images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 14px;

    & a {
        display: block;
        cursor: zoom-in;
    }

    & img {
        display: block;
        width: 100%;
        height: auto;
        box-shadow: var(--shadow-photo);
    }
}

@media (min-width: 600px) {
    .book {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "images text";
        align-items: start;
        gap: 28px;
    }

    .book__text {
        grid-area: text;
    }

    .book__images {
        grid-area: images;
    }
}

/* Press clippings: two per row on phones, four from 600px, cropped to the top. */
.press-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 600px) {
    .press-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.press-clipping {
    display: block;
    color: var(--color-heading);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    cursor: zoom-in;

    & img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 5 / 8;
        margin-bottom: 8px;
        object-fit: cover;
        object-position: top;
        box-shadow: var(--shadow-photo);
    }

    &:hover {
        text-decoration: none;

        & img {
            opacity: 0.85;
        }
    }
}

/* Film list: titled videos, one under the other. */
.film-list {
    display: grid;
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.film__title {
    margin: 0 0 10px;
    font-size: 1.125rem;
}

.films-note {
    margin: 32px 0 0;
    color: var(--color-muted);
    font-size: 0.8125rem;
}

/* Video: a poster that turns into the YouTube player (see assets/js/youtube.js),
   framed at the video's own aspect ratio. */
.video {
    position: relative;
    background: #000;
}

.video--4x3 {
    aspect-ratio: 4 / 3;
}

.video--16x9 {
    aspect-ratio: 16 / 9;
}

.video__poster,
.video__player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video__poster {
    display: block;

    & img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    &:is(:hover, :focus-visible) .video__play {
        background-color: rgb(0 0 0 / 0.85);
        scale: 1.08;
    }
}

/* Round play button with a CSS triangle. */
.video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    border: 2px solid rgb(255 255 255 / 0.85);
    border-radius: 50%;
    background: rgb(0 0 0 / 0.55);
    translate: -50% -50%;
    transition: background-color 0.2s, scale 0.2s;

    &::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 54%;
        border-style: solid;
        border-width: 14px 0 14px 24px;
        border-color: transparent transparent transparent #fff;
        translate: -50% -50%;
    }
}

/* Contact: the contact person and a large email link. */
.contact__person {
    margin: 0 0 8px;
    color: var(--color-heading);
    font-size: 1.125rem;
    font-weight: 600;
}

.contact__email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.125rem;
    overflow-wrap: anywhere;      /* the address never overflows a narrow phone */

    & svg {
        flex: none;
        width: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
    }
}


/* 9. Pages
   ========================================================================== */

.page-home .site-main {
    padding-bottom: 56px;
}
