/*
Theme Name: BilingualClassics
Author: Elisa Demonki
*/

:root {
  --bg: #f5f0e7;
  --text: #111;
  --muted: #777;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.16);
  --radius: 10px;
  --gutter: clamp(16px, 4.5vw, 80px);
  --gap: clamp(16px, 2.6vw, 44px);
  --line: rgba(0, 0, 0, 0.18);
  --glow: #fffaf0;
  --header-fade: rgba(245, 240, 231, 0.92);
  --ghost: rgba(255, 255, 255, 0.55);
  --solid: #fff;
  --popover-bg: rgba(255, 255, 255, 0.92);
  --cta-bg: rgba(255, 255, 255, 0.92);
  --cta-fg: #111;
  --hover-fill: rgba(0, 0, 0, 0.06);
  --accent: #263a33;
  --accent-contrast: #fff;
  --soft: #e8efeb;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101522;
  --text: #f3f4fa;
  --muted: #aab3c8;
  --shadow: 0 20px 55px rgba(3, 7, 18, 0.4);
  --line: rgba(255, 255, 255, 0.14);
  --glow: #2b3858;
  --header-fade: rgba(16, 21, 34, 0.92);
  --ghost: rgba(31, 41, 62, 0.74);
  --solid: #202a3d;
  --popover-bg: rgba(23, 30, 45, 0.94);
  --cta-bg: rgba(32, 42, 61, 0.94);
  --cta-fg: #f3f4fa;
  --hover-fill: rgba(255, 255, 255, 0.08);
  --accent: #b8c8ff;
  --accent-contrast: #111827;
  --soft: #242e49;
  background: var(--bg);
}

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

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 20% 0%, var(--glow) 0, transparent 30%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 200ms ease;
}

html[data-theme="dark"] body {
  background: radial-gradient(circle at 20% 0%, #353f54 0, transparent 30%), var(--bg);
}

body.single {
  display: flex;
  flex-direction: column;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 10;
  user-select: none;
  background: linear-gradient(to bottom, var(--header-fade), transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.brand-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.site-header a,
.site-header button {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  padding: 10px 6px;
  cursor: pointer;
}

.site-header .brand-wrap > :first-child {
  padding-left: 0;
}

.site-header .brand-wrap a,
.site-header .brand-wrap button {
  font-size: 17px;
}

.site-header .brand-section {
  color: var(--muted);
  font-weight: 550;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--ghost);
  border-radius: 999px;
}

.theme-option {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/css/fonts/material-symbols-outlined.woff2") format("woff2");
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

html[data-theme="light"] .theme-light,
html[data-theme="dark"] .theme-dark {
  background: var(--accent);
  color: var(--accent-contrast);
}

.lang-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
}

.site-header .theme-toggle,
.site-header .lang-btn {
  border: 1px solid var(--line);
  background: var(--ghost);
}

.site-header .theme-toggle {
  padding: 3px;
}

.site-header .lang-btn {
  padding: 8px 12px;
}

html[data-theme="light"] .site-header .theme-toggle,
html[data-theme="light"] .site-header .lang-btn {
  border: 0;
  background: #3b5bff;
  color: #fff;
}

html[data-theme="light"] .site-header .theme-toggle:hover,
html[data-theme="light"] .site-header .lang-btn:hover {
  background: #2e4ce8;
  color: #fff;
}

html[data-theme="light"] .site-header .theme-option {
  background: transparent;
  color: rgb(245 240 231);
}

html[data-theme="light"] .site-header .theme-light {
  background: #f5f0e7;
  color: #2f47ff;
}

.chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  opacity: 0.7;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--popover-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px;
  display: none;
  z-index: 30;
}

.popover.open {
  display: block;
}

.popover a {
  display: block;
  padding: 12px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
}

.popover a:hover {
  background: var(--hover-fill);
}

.site-main {
  min-height: 100%;
  padding-top: 92px;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-bottom: 60px;
}

.home .site-main {
  min-height: 100vh;
  min-height: 100dvh;
}

.single .site-main {
  min-height: 0;
  flex: 0 0 auto;
}

.home .hero {
  padding: 54px 4px 36px;
  max-width: 820px;
}

.home .hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.12;
  font-size: clamp(43px, 7vw, 76px);
  margin: 12px 0 18px;
  text-transform: none;
}

.home .hero .lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 8px;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: flex-start;
  justify-content: center;
}

.grid > * {
  flex: 0 0 calc((100% - var(--gap)) / 2);
  max-width: calc((100% - var(--gap)) / 2);
}

@media (min-width: 900px) {
  .grid > * {
    flex-basis: calc((100% - (3 * var(--gap))) / 4);
    max-width: calc((100% - (3 * var(--gap))) / 4);
  }
}

figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.poster {
  width: 100%;
  aspect-ratio: 1 / 1.6;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--solid);
  box-shadow: var(--shadow);
  transform: none;
  transition: transform 180ms ease;
  position: relative;
  animation: popIn 260ms ease both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.poster:hover {
  transform: translateY(-2px);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  pointer-events: none;
}

figcaption {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

figcaption a {
  color: inherit;
  text-decoration: none;
}

figcaption a:hover {
  color: var(--text);
}

.cta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 2;
}

.cta a {
  width: 100%;
  text-align: center;
  text-decoration: none;
  color: var(--cta-fg);
  background: var(--cta-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.poster .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 55%);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
  z-index: 1;
}

.poster.active .cta {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.poster.active .veil {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .poster:hover .cta {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .poster:hover .veil {
    opacity: 1;
  }
}

.single .site-main {
  padding-top: 110px;
}

.single .site-main .container {
  max-width: 1180px;
  margin: 0 auto;
}

.single .site-main article {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

@media (min-width: 980px) {
  .single .site-main article {
    display: grid;
    grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 52px);
    align-items: start;
  }

  .single .entry-header {
    grid-column: 1 / -1;
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

  .single .post-thumbnail {
    grid-column: 1;
    position: sticky;
    top: 104px;
    align-self: start;
  }

  .single .entry-content {
    grid-column: 2;
    min-width: 0;
  }
}

@media (max-width: 979px) {
  .single .entry-header {
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .single .post-thumbnail {
    margin: 14px 0 18px 0;
  }
}

.single .entry-title {
  margin: 0 0 14px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-size: clamp(38px, 5.5vw, 72px);
  text-transform: none;
}

.single .entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.single .entry-meta span + span::before {
  content: "·";
  margin-right: 10px;
}

.single .entry-content {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.65;
  color: var(--text);
}

.single .entry-content > * + * {
  margin-top: 1.25em;
}

.single .entry-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-top: 1.8em;
  text-transform: none;
}

.single .entry-content h3 {
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin-top: 1.6em;
}

.single .entry-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.single .entry-content a:hover {
  background: var(--hover-fill);
}

.single .entry-content ul,
.single .entry-content ol {
  padding-left: 1.1em;
}

.single .entry-content li + li {
  margin-top: 0.35em;
}

.single blockquote {
  margin: 1.6em 0;
  padding: 1.1em 1.2em;
  border-left: 6px solid var(--text);
  background: transparent;
  font-weight: 650;
}

.single .post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
  background: var(--solid);
}

.single .post-navigation {
  margin-top: clamp(18px, 3vw, 44px);
  padding-top: 16px;
}

.single .post-navigation a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: transparent;
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}

.single .post-navigation a:hover {
  background: var(--text);
  color: var(--bg);
}

footer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 48px;
  padding: 0 var(--gutter) 28px;
}

body.single > footer {
  margin-top: 0;
  padding-top: 20px;
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 650px) {
  .site-header {
    height: auto;
    min-height: 76px;
    align-items: flex-start;
    padding: 12px var(--gutter);
  }
}

.kindle-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}

.kindle-cta a:hover {
  background: var(--solid);
}
