/* =========================================================================
   Alexey Shelygin — composer site
   =========================================================================

   Design notes
   ------------
   The palette is inherited from the 2011 RocketTheme Iridium "style4" skin so
   the site stays recognisable: deep navy chrome, a single blue accent, white
   content. Everything else is rebuilt.

   The organising idea is a *catalogue*. A film composer's output is a dated
   work-list, so entries are set against a left rail carrying the year, with
   hairline rules between them — the structure encodes the chronology rather
   than decorating it. Card grids are reserved for discography and photos,
   where the image genuinely is the content.

   Type pairs a serif display (the conservatory / concert-hall side of his
   work) against a system sans for body copy. Both stacks are chosen for solid
   Cyrillic coverage and ship with the OS, so there is no webfont download and
   no build step.
   ========================================================================= */

:root {
    --navy: #0f2445;
    --navy-deep: #091628;
    --navy-line: #1e3a63;
    --accent: #3366cc;
    --accent-strong: #244c9c;

    --ink: #1b2430;
    --ink-muted: #5c6775;
    --rule: #dde3ec;
    --surface: #ffffff;
    --surface-alt: #f4f7fb;

    --font-display: Georgia, 'PT Serif', 'Droid Serif', 'Times New Roman', serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --wrap: 68rem;
    --gap: clamp(1rem, 3vw, 2rem);
    --radius: 3px;
}

/* ---------- reset-ish ---------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;   /* keeps the footer at the bottom on short pages */
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

.site-main { flex: 1 0 auto; }

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    background: var(--accent);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- header ---------- */

.site-header {
    background: var(--navy);
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    padding: 1.1rem 0;
}

/* The logo yields space; the menu button never does. Sizing this
   proportionally rather than at a breakpoint means the control stays
   reachable at any width, including the very narrow ones. */
.logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(340px, 55%);
}
.logo img { display: block; width: 100%; height: auto; }

.header-aside {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .6rem;
}

.nav-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border: 1px solid var(--navy-line);
    border-radius: var(--radius);
    color: #fff;
    font: inherit;
    font-size: .9rem;
    padding: .45rem .8rem;
    cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    content: '';
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before { position: absolute; top: -6px; }
.nav-toggle-bar::after { position: absolute; top: 6px; }

/* ---------- navigation ---------- */

.site-nav {
    background: var(--navy-deep);
    border-top: 1px solid var(--navy-line);
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-list > li { position: relative; }

.nav-list a,
.nav-list .nav-label {
    display: block;
    padding: .8rem .9rem;
    color: #c8d5e8;
    font-size: .95rem;
    text-decoration: none;
    white-space: nowrap;
}
.nav-list > li > a:hover { color: #fff; background: var(--navy-line); }
.nav-list .nav-label { color: #8fa3c2; cursor: default; }
.nav-list > li.is-active > a,
.nav-list > li.is-active > .nav-label,
.nav-list a[aria-current] { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }

.nav-sub {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Desktop: the bar shows in full, so the toggle is unnecessary. */
@media (min-width: 56rem) {
    .nav-toggle { display: none; }
}

/* Desktop: submenus drop out of the bar. */
@media (min-width: 56rem) {
    .nav-sub {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 20;
        min-width: 14rem;
        background: var(--navy-deep);
        border: 1px solid var(--navy-line);
        border-top: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity .15s ease, transform .15s ease, visibility .15s;
    }
    .nav-list > li:hover .nav-sub,
    .nav-list > li:focus-within .nav-sub {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .nav-sub a { padding: .55rem .9rem; }
    .nav-sub a:hover { background: var(--navy-line); color: #fff; }
}

/* Mobile: the toggle button appears and the bar becomes a stack. Without JS
   the nav stays open rather than being trapped behind a dead button. */
@media (max-width: 55.99rem) {
    .nav-list { flex-direction: column; align-items: stretch; }
    .nav-list a, .nav-list .nav-label { padding: .7rem .2rem; }
    .nav-sub a { padding-left: 1.4rem; font-size: .9rem; }
    .site-nav.js .nav-list { display: none; }
    .site-nav.js.is-open .nav-list { display: flex; padding-bottom: .8rem; }
    .nav-list > li + li { border-top: 1px solid var(--navy-line); }
}

/* ---------- main ---------- */

.site-main {
    padding: clamp(1.75rem, 5vw, 3.25rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

/* The home page opens with a full-bleed tinted band, which the main padding
   pushed away from the nav as a white strip. The band brings its own padding. */
.page-home .site-main { padding-top: 0; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--navy);
    margin: 0 0 .6em;
    text-wrap: balance;
}

h1 { font-size: clamp(1.65rem, 3.6vw, 2.35rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
h3 { font-size: 1.15rem; }

.section-head { margin-bottom: 2rem; }
.section-head h1 { margin-bottom: .35rem; }
.section-head::after {
    display: block;
    width: 3.5rem;
    height: 3px;
    margin-top: .9rem;
    background: var(--accent);
    content: '';
}

.section-intro { color: var(--ink-muted); max-width: 62ch; }
.section-outro { margin-top: 2rem; }

.empty { color: var(--ink-muted); font-style: italic; }

/* ---------- prose ---------- */

.prose { max-width: 72ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose img {
    border-radius: var(--radius);
    margin: .4rem 1.2rem .8rem 0;
}
.prose > p > img:only-child { display: block; margin-inline: auto; }
.prose strong { color: var(--navy); }
.prose blockquote {
    margin: 1.5rem 0;
    padding: .2rem 0 .2rem 1.2rem;
    border-left: 3px solid var(--accent);
    color: var(--ink-muted);
    font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.breadcrumb { margin-bottom: 1rem; font-size: .9rem; }
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.entry-date, .card-date {
    margin: -.3rem 0 1.2rem;
    color: var(--ink-muted);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

.entry-source { font-size: .9rem; color: var(--ink-muted); }

/* ---------- catalogue listing (the signature) ----------
   Entries sit against a left rail holding the year. On narrow screens the
   rail collapses above the title rather than squeezing the text. */

.card-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.card {
    display: grid;
    grid-template-columns: 6.4rem 1fr auto;
    gap: 0 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rule);
}

.card-date {
    grid-column: 1;
    grid-row: 1 / span 3;
    margin: .15rem 0 0;
    font-family: var(--font-display);
    font-size: .95rem;
    color: var(--accent);
}

.card-body { grid-column: 2; }

.card-body h2 {
    margin: 0 0 .3rem;
    font-size: 1.2rem;
}
.card-body h2 a { color: var(--navy); text-decoration: none; }
.card-body h2 a:hover { color: var(--accent); }

.card-summary { color: var(--ink-muted); font-size: .95rem; }
.card-summary p { margin: 0 0 .5em; }
.card-summary img { display: none; }

.card-more {
    display: inline-block;
    margin-top: .3rem;
    font-size: .88rem;
    text-decoration: none;
}
.card-more:hover { text-decoration: underline; }

.card-media {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: start;
}
.card-media img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Listings whose items carry no date lose the rail entirely. */
.card:not(:has(.card-date)) { grid-template-columns: 1fr auto; }
.card:not(:has(.card-date)) .card-body { grid-column: 1; }
.card:not(:has(.card-date)) .card-media { grid-column: 2; }

@media (max-width: 40rem) {
    .card { grid-template-columns: 1fr 72px; }
    .card-date { grid-column: 1; grid-row: auto; margin-bottom: .2rem; }
    .card-body { grid-column: 1; }
    .card-media { grid-column: 2; grid-row: 1 / span 3; }
    .card-media img { width: 72px; height: 72px; }
}

/* ---------- pagination ---------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 2.5rem;
}
.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination a, .pagination span {
    display: block;
    min-width: 2.2rem;
    padding: .4rem .6rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    font-size: .9rem;
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--accent); }
.pagination [aria-current] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination-prev, .pagination-next { white-space: nowrap; }

/* ---------- adjacent nav ---------- */

.adjacent {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--rule);
    font-size: .92rem;
}
.adjacent a { text-decoration: none; }
.adjacent a:hover { text-decoration: underline; }
.adjacent-next { margin-left: auto; text-align: right; }

/* ---------- discography ---------- */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.album a {
    display: block;
    color: inherit;
    text-decoration: none;
}
.album-cover {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-alt);
    box-shadow: 0 1px 3px rgba(15, 36, 69, .18);
}
.album-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.album a:hover .album-cover img { transform: scale(1.04); }
.album-cover-blank { display: block; width: 100%; height: 100%; }

.album-title {
    display: block;
    margin-top: .6rem;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--navy);
    line-height: 1.35;
}
.album a:hover .album-title { color: var(--accent); }
.album-year {
    display: block;
    color: var(--ink-muted);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.album-page .prose img { float: left; margin: .2rem 1.4rem 1rem 0; max-width: 220px; }

.tracklist {
    clear: both;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--rule);
}
.tracklist ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: track;
}
.tracklist li {
    display: flex;
    gap: .8rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--surface-alt);
    counter-increment: track;
}
.tracklist li::before {
    content: counter(track, decimal-leading-zero);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
    min-width: 1.8rem;
}

/* ---------- photo galleries ---------- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .8rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}
.photo-grid a { display: block; }
.photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    transition: opacity .2s ease;
}
.photo-grid a:hover img { opacity: .85; }

/* ---------- video ---------- */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--navy-deep);
    border-radius: var(--radius);
    overflow: hidden;
}
.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- section index ---------- */

.section-links {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}
.section-links a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem .2rem;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
}
.section-links a:hover { background: var(--surface-alt); }
.section-link-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--navy); }
.section-links a:hover .section-link-title { color: var(--accent); }
.section-link-count { color: var(--ink-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* ---------- home ---------- */

.home-intro {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--rule);
    padding: clamp(1.75rem, 5vw, 3rem) 0;
}
/* Two real columns rather than a float. The portrait is taller than its
   first paragraph, so floating it left the following paragraph starting at
   the float's edge with a ragged left margin. */
.home-intro-inner {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.75rem);
    align-items: start;
}

.home-portrait { margin: 0; }
.home-portrait img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(15, 36, 69, .2);
}

.home-copy { max-width: 68ch; }
.home-copy > p:first-child { margin-top: 0; font-size: 1.1rem; }

@media (max-width: 46rem) {
    .home-intro-inner { grid-template-columns: 1fr; }
    .home-portrait { max-width: 190px; }
}

.home-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-top: clamp(2rem, 5vw, 3rem);
}

.panel h2 {
    margin-bottom: .9rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.05rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.panel h2 a { color: inherit; text-decoration: none; }
.panel h2 a:hover { color: var(--accent); }

.teaser-list { margin: 0; padding: 0; list-style: none; }
.teaser-list li { padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.teaser-list time {
    display: block;
    color: var(--ink-muted);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}
.teaser-list a { text-decoration: none; font-size: .95rem; }
.teaser-list a:hover { text-decoration: underline; }

.teaser-albums { margin: 0; padding: 0; list-style: none; }
.teaser-albums li { border-bottom: 1px solid var(--rule); }
.teaser-albums a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem 0;
    text-decoration: none;
    font-size: .95rem;
}
.teaser-albums img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); flex: none; }
.teaser-albums a:hover span { text-decoration: underline; }

.panel-more {
    display: inline-block;
    margin-top: .9rem;
    font-size: .88rem;
    text-decoration: none;
}
.panel-more:hover { text-decoration: underline; }

/* ---------- footer ---------- */

.site-footer {
    background: var(--navy);
    color: #b9c8e0;
    margin-top: auto;
    padding: clamp(2rem, 5vw, 3rem) 0 1.5rem;
    font-size: .93rem;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    justify-content: space-between;
}
.site-footer h2 {
    color: #fff;
    font-size: .95rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 .4rem; }

.footer-social ul {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .4rem 1.5rem;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--navy-line);
    font-size: .85rem;
    color: #7f93b3;
}
.footer-legal p { margin: 0; }

/* Editor's entry point: present but recessive — it sits at the same weight as
   the copyright line and only picks up the accent on interaction. */
.footer-admin a {
    color: #6b7f9e;
    font-size: .8rem;
    text-decoration: none;
}
.footer-admin a:hover,
.footer-admin a:focus-visible { color: #fff; text-decoration: underline; }

/* ---------- motion ---------- */

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

/* ---------- print ---------- */

@media print {
    .site-header, .site-nav, .site-footer, .pagination, .adjacent, .skip-link { display: none; }
    body { font-size: 11pt; }
    a { color: inherit; text-decoration: underline; }
}
