/* ==========================================================================
   Martina Filjak – pianist
   Shared stylesheet for all template pages (index, calendar, biography).
   Designed against 1920 × 1080 mock-ups; fluid below that.
   ========================================================================== */

:root {
  /* Fonts (Google Fonts): Tinos ≈ Times New Roman, Arimo ≈ Helvetica/Arial, Cardo ≈ logo serif */
  --font-serif: "Tinos", "Times New Roman", Times, serif;
  --font-sans: "Arimo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-logo: "Cardo", "Palatino Linotype", Palatino, "Book Antiqua", serif;

  /* Colours */
  --ink: #000;
  --paper: #fff;
  --backdrop: #1a2b2a;                    /* shown while the photo loads */
  --panel-bg: rgba(213, 213, 213, 0.95);  /* content panel over the photo */
  --cell-bg: rgba(255, 255, 255, 0.44);   /* table header + pager buttons */
  --nav-highlight: #e0e0e0;               /* menu hover / current page */
  --rule: #1c1c1c;
  --link: #ed230d;

  /* Layout */
  --gutter: 16px;
  --panel-width: 823px;
}

*,
*::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(--backdrop);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 18px;
}

/* Full-page background photo. A fixed pseudo-element is used instead of
   `background-attachment: fixed`, which is unreliable on iOS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--backdrop) url("../images/background-image.jpg") center / cover no-repeat;
}

/* Portrait screens: slide the crop towards the pianist */
@media (max-aspect-ratio: 1/1) {
  body::before {
    background-position: 82% center;
  }
}

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

a {
  color: inherit;
}

/* ==========================================================================
   Header: logo + main menu
   ========================================================================== */

.site-header {
  position: relative;
  padding: 20px var(--gutter) 0 37px;
}

.logo {
  display: inline-block;
  color: var(--paper);
  text-decoration: none;
  /* keeps the white logo legible where the photo crops to bright sky */
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.logo-name {
  display: block;
  font-family: var(--font-logo);
  font-size: 63px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-role {
  display: block;
  margin: -10px 0 0 5px;
  font-family: var(--font-logo);
  font-size: 17px;
  line-height: 1;
}

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

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0 17px 2px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 24px;
  line-height: 33px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

/* Hover / keyboard focus / current page all share the same highlight. */
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  background-color: var(--nav-highlight);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Wide screens: menu sits to the right of the logo, as in the mock-up. */
@media (min-width: 1200px) {
  .site-nav {
    position: absolute;
    top: 34px;
    left: max(calc(39.32vw + 16px), 616px);
    margin-top: 0;
  }

  .site-nav ul {
    flex-wrap: nowrap;
    gap: 0 40px;
  }

  /* Labels keep a fixed 40px rhythm; the highlight box is a pseudo-element
     centred on each label, at least 132px wide (as in the mock-ups). */
  .site-nav a {
    position: relative;
    z-index: 0;
    padding: 0 0 2px;
  }

  .site-nav a::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: max(132px, calc(100% + 27px));
    transform: translateX(-50%);
    background-color: transparent;
    transition: background-color 0.2s ease;
  }

  .site-nav a:hover,
  .site-nav a:focus-visible,
  .site-nav a[aria-current="page"] {
    background-color: transparent;
  }

  .site-nav a:hover::before,
  .site-nav a:focus-visible::before,
  .site-nav a[aria-current="page"]::before {
    background-color: var(--nav-highlight);
  }
}

/* Small screens: the menu drops below the logo and gets its own light bar
   so the black labels stay readable on top of the dark photo. */
@media (max-width: 1199px) {
  .site-header {
    padding-bottom: 0;
    background: linear-gradient(rgba(16, 32, 30, 0.75), rgba(16, 32, 30, 0.45));
  }

  .site-nav {
    margin: 14px calc(var(--gutter) * -1) 0 -37px;
    padding: 6px var(--gutter) 6px 37px;
    background: rgba(255, 255, 255, 0.85);
  }

  .site-nav a:hover,
  .site-nav a:focus-visible,
  .site-nav a[aria-current="page"] {
    background-color: rgba(0, 0, 0, 0.12);
  }
}

@media (max-width: 599px) {
  .site-header {
    padding-left: var(--gutter);
  }

  .site-nav {
    margin-left: calc(var(--gutter) * -1);
    padding-left: var(--gutter);
  }

  .logo-name {
    font-size: clamp(32px, 11vw, 63px);
  }

  .logo-role {
    margin: -3px 0 0 4px;
    font-size: clamp(13px, 3.2vw, 16px);
  }

  .site-nav ul {
    gap: 2px 0;
  }

  .site-nav a {
    padding: 0 8px 2px;
    font-size: clamp(15px, 4.2vw, 19px);
    line-height: 30px;
  }
}

/* ==========================================================================
   Main content
   ========================================================================== */

main {
  width: 100%;
  padding: 24px var(--gutter) 60px;
}

@media (min-width: 1200px) {
  main {
    /* header is 141px tall on desktop; extra left padding nudges the panel
       33px right of centre, as in the mock-ups */
    padding-top: 0;
    padding-left: calc(var(--gutter) + 67px);
  }

  .site-header {
    height: 141px;
  }
}

.panel {
  width: 100%;
  max-width: var(--panel-width);
  margin: 0 auto;
  background: var(--panel-bg);
}

/* ---------- Calendar ---------- */

.panel--calendar {
  padding: 23px 9px 13px 13px;
}

.concerts {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.concerts th {
  height: 30px;
  padding: 0 0 0 7px;
  background: var(--cell-bg);
  font-weight: 700;
  line-height: 30px;
}

.concerts th:first-child {
  width: 30%;
}

/* 2px gutter between the two header cells */
.concerts th:last-child {
  padding-left: 9px;
  border-left: 2px solid transparent;
  background-clip: padding-box;
}

.concerts td {
  padding: 23px 0 14.4px 5px;
  vertical-align: top;
}

.concerts td:last-child {
  padding-left: 11px;
}

.concerts tbody tr:first-child td {
  padding-top: 19px;
}

/* 1px divider under every row, inset 2px from the panel's left edge */
.concerts tbody tr {
  background: linear-gradient(var(--rule), var(--rule)) 2px 100% / calc(100% - 3px) 1px no-repeat;
}

.concerts time,
.concerts .place {
  display: block;
}

.concerts .place {
  font-weight: 700;
}

.concerts .concert-link {
  display: block;
  color: var(--link);
  text-decoration: none;
}

.concerts .concert-link:hover,
.concerts .concert-link:focus-visible {
  text-decoration: underline;
}

.pager {
  display: flex;
  gap: 3px;
  margin-top: 19px;
}

.pager a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background: var(--cell-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.pager a:hover,
.pager a:focus-visible {
  background-color: var(--nav-highlight);
}

/* Stack each concert on narrow screens instead of squeezing two columns */
@media (max-width: 640px) {
  .panel--calendar {
    padding: 12px;
  }

  .concerts thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .concerts,
  .concerts tbody,
  .concerts tr,
  .concerts td {
    display: block;
    width: 100%;
  }

  .concerts tbody tr {
    padding: 14px 4px 12px;
    background-position: 0 100%;
    background-size: 100% 1px;
  }

  .concerts td,
  .concerts td:last-child,
  .concerts tbody tr:first-child td {
    padding: 0;
  }

  .concerts td:last-child {
    margin-top: 6px;
  }

  .concerts {
    font-size: 13px;
    line-height: 17px;
  }
}

/* ---------- Biography ---------- */

.panel--biography {
  padding: 15px 19px 18px 18px;
}

.panel--biography p {
  margin: 0 0 13.33px;
}

.panel--biography blockquote {
  margin: 0 0 26px;
  font-style: italic;
}

.panel--biography blockquote p {
  margin: 0;
}

.panel--biography blockquote footer {
  font-style: normal;
  font-weight: 700;
}

.panel--biography cite {
  font-style: normal;
}

.panel--biography h2 {
  margin: 0 0 13.33px;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

/* Links look like everywhere else: plain text, underlined on hover/focus */
.panel--biography a {
  color: inherit;
  text-decoration: none;
}

.panel--biography a:hover,
.panel--biography a:focus-visible {
  text-decoration: underline;
}

/* Download links: a tight list, one per line */
.downloads {
  margin: 0 0 13.33px;
  padding: 0;
  list-style: none;
}

.downloads li {
  line-height: 18px;
}

/* Photo gallery: five thumbnails per row, each downloads the large file */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 111px);
  justify-content: space-between;
  gap: 20px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  min-width: 0;
}

.gallery a {
  display: block;
  transition: opacity 0.2s ease;
}

.gallery a:hover,
.gallery a:focus-visible {
  text-decoration: none;
  opacity: 0.8;
}

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

.panel--biography .photo-credits {
  margin-top: 20px;
}

/* Keep five per row while there is room, then step down */
@media (max-width: 800px) {
  .gallery {
    grid-template-columns: repeat(5, minmax(0, 111px));
    gap: 14px 8px;
  }
}

@media (max-width: 520px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 111px));
    gap: 14px 12px;
  }
}

@media (max-width: 640px) {
  .panel--biography {
    padding: 14px 14px 6px;
    font-size: 13px;
    line-height: 18px;
  }
}

/* ---------- Multimedia ---------- */

.panel--multimedia {
  padding: 22px 10px 38px 12px;
  font-family: var(--font-sans);
}

.panel-heading {
  height: 30px;
  margin: 0;
  background: var(--cell-bg);
  padding: 1px 72px 0 0;  /* mock-up centres the label left of the bar's middle */
  font-size: 13.6px;
  font-weight: 700;
  line-height: 29px;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 25px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.video-grid img,
.album-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.video-thumb,
.album-cover {
  display: block;
  transition: opacity 0.2s ease;
}

.video-thumb:hover,
.album-cover:hover {
  opacity: 0.85;
}

.video-title {
  margin: 14px 0 0;
  padding-left: 2px;
  font-size: 12px;
  font-weight: 400;
  line-height: 15px;
}

.video-title a,
.album-title a {
  color: inherit;
  text-decoration: none;
}

.video-title a:hover,
.video-title a:focus-visible,
.album-title a:hover,
.album-title a:focus-visible {
  text-decoration: underline;
}

.discography {
  /* the mock-up sets this block 4px left of the videos block */
  margin: 8px 4px 0 -4px;
}

.discography .panel-heading {
  padding-right: 64px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px 0;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.album {
  display: grid;
  grid-template-columns: 134px 1fr;
  grid-template-areas:
    "cover info"
    "buy   buy";
  align-content: start;
  column-gap: 11px;
}

.album-cover {
  grid-area: cover;
  width: 134px;
}

.album-info {
  grid-area: info;
  padding-top: 0;
}

.album-title {
  margin: -1px 0 7px;
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
}

.album-meta {
  margin: 0;
  padding-left: 2px;
  font-size: 11px;
  line-height: 13px;
}

.album-buy {
  grid-area: buy;
  margin: 7px 0 0;
  padding-left: 3px;
  font-size: 11px;
  line-height: 14px;
}

.album-buy a {
  color: inherit;
  text-decoration: none;
}

.album-buy a:hover,
.album-buy a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-heading,
  .discography .panel-heading {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .panel--multimedia {
    padding: 12px 12px 24px;
  }

  .discography {
    margin: 18px 0 0;
  }

  .video-grid {
    gap: 18px 14px;
  }

  .album-grid {
    grid-template-columns: 1fr;
  }

  .video-title {
    font-size: 13px;
    line-height: 17px;
  }

  .album-meta,
  .album-buy {
    font-size: 12px;
  }
}

/* ---------- Contact ---------- */

.panel--contact {
  padding: 32px 25px 30px;
  font-family: var(--font-sans);
  font-size: 13.4px;
  line-height: 15.33px;
}

@media (min-width: 1200px) {
  .panel--contact {
    min-height: 764px;
  }
}

.contact-group {
  margin: 0 0 15.33px;
}

.contact-group h2 {
  margin: 0 0 15.33px;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.contact-group:first-of-type h2 {
  margin-bottom: 11.7px;
}

.contact-group address {
  font-style: normal;
}

.contact-group p {
  margin: 0;
}

.contact-group a {
  color: inherit;
  text-decoration: none;
}

.contact-group a:hover,
.contact-group a:focus-visible {
  text-decoration: underline;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: block;
  width: 24px;
  height: 24px;
  color: #000;
  transition: opacity 0.2s ease;
}

.social a:hover,
.social a:focus-visible {
  opacity: 0.6;
}

.social svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Frontpage footer: the same icons, centred under the quote and lifted off
   the photo with a light glow (text-shadow has no effect on SVG shapes, so
   this uses the filter equivalent, drop-shadow, stacked the same way). */
.footer-social {
  justify-content: center;
  margin-top: 24px;
}

.footer-social a {
  filter:
    drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.8))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.6));
}

@media (max-width: 599px) {
  .footer-social {
    margin-top: 18px;
  }
}

@media (max-width: 640px) {
  .panel--contact {
    padding: 20px 16px 24px;
    font-size: 14px;
    line-height: 17px;
  }

  .contact-group,
  .contact-group h2 {
    margin-bottom: 17px;
  }

  .contact-group:first-of-type h2 {
    margin-bottom: 13px;
  }
}

/* ==========================================================================
   Footer: press quote
   ========================================================================== */

.site-footer {
  margin-top: auto;
  padding: 0 var(--gutter) 27px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 22px;
  text-align: center;
}

.press-quote {
  max-width: 880px;
  margin: 0 auto;
}

.press-quote blockquote {
  margin: 0;
}

.press-quote blockquote p {
  margin: 0;
  text-wrap: balance;
}

.press-quote .line {
  display: block;
}

.press-quote figcaption {
  margin-top: 22px;
}

.press-quote cite {
  font-style: normal;
}

@media (max-width: 599px) {
  .site-footer {
    padding-bottom: 20px;
    font-size: 15px;
    line-height: 19px;
  }

  .press-quote figcaption {
    margin-top: 19px;
  }
}

/* Frontpage: the quote sits straight on the photo with no panel behind it,
   so lift it off the background with a soft light halo behind the letters
   rather than a panel. */
.site-footer--shaded .press-quote blockquote,
.site-footer--shaded .press-quote figcaption {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, 0.9),
    0 0 6px rgba(255, 255, 255, 0.8),
    0 0 16px rgba(255, 255, 255, 0.7),
    0 0 28px rgba(255, 255, 255, 0.5);
}

/* Reduce motion for people who ask for it */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
