/* efepa.gr, "Night at the Estia". Change the look from the tokens below. */

@font-face { font-family: "Comic Relief"; font-weight: 400; font-display: swap; src: url("/assets/fonts/comic-relief-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Comic Relief"; font-weight: 400; font-display: swap; src: url("/assets/fonts/comic-relief-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1EFF; }
@font-face { font-family: "Comic Relief"; font-weight: 400; font-display: swap; src: url("/assets/fonts/comic-relief-greek-400-normal.woff2") format("woff2"); unicode-range: U+0370-03FF; }
@font-face { font-family: "Comic Relief"; font-weight: 700; font-display: swap; src: url("/assets/fonts/comic-relief-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Comic Relief"; font-weight: 700; font-display: swap; src: url("/assets/fonts/comic-relief-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1EFF; }
@font-face { font-family: "Comic Relief"; font-weight: 700; font-display: swap; src: url("/assets/fonts/comic-relief-greek-700-normal.woff2") format("woff2"); unicode-range: U+0370-03FF; }

:root {
  --night: #070b17;
  --panel: #0a0f1e;
  --text: #e9e6de;
  --text-soft: #b8bfd1;
  --amber: #ffb347;
  --amber-soft: #ffd391;
  --heading: #ffffff;
  --slogan: #fff3d6;
  --horizon: #7a5732;
  --dusk: #2a3a5c;
  --line: rgb(255 255 255 / 0.1);
  --amber-line: rgb(255 179 71 / 0.28);
  --lift: 0 14px 34px rgb(0 0 0 / 0.55);
  --tile-text: #161616;
  --tile-link: #7a4200;
  --paper: url("/assets/theme/papyrus.jpg");
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  --font-comic: "Comic Sans MS", "Comic Relief", cursive;
  --step-small: 0.875rem;
  --step-body: 1.0625rem;
  --step-title: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --space: 1rem;
  --list-width: 58rem;
  --measure: 72ch;
}

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

html { background: var(--night); color-scheme: dark; }

body {
  margin: 0;
  color: var(--text);
  font: var(--step-body) / 1.7 var(--font-body);
  overflow-wrap: break-word;
}

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

a { color: var(--amber); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { color: var(--amber-soft); text-decoration: underline; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--amber-soft); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--night); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 0.5rem; top: 0.5rem; z-index: 20; background: var(--night); padding: 0.5rem 1rem; }

/* ---------- header: the building under the night sky ---------- */

.sky {
  position: relative;
  isolation: isolate;
  display: block;
  padding-top: clamp(1rem, 3.5vw, 2.5rem);
  background: radial-gradient(85% 75% at 50% 108%, var(--horizon) 0%, var(--dusk) 40%, #0d1428 72%, var(--night) 100%);
  text-align: center;
}
.sky:hover { text-decoration: none; }
.sky:focus-visible { outline-offset: -4px; }

/* Stars, drawn with gradients: two tiles of different sizes so the pattern does not read as a grid. */
.sky::before {
  content: "";
  position: absolute;
  inset: 0 0 35% 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 37% 63%, rgb(255 255 255 / 0.8) 50%, transparent 52%),
    radial-gradient(1px 1px at 58% 12%, rgb(255 255 255 / 0.7) 50%, transparent 52%),
    radial-gradient(1px 1px at 81% 48%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 92% 82%, rgb(255 255 255 / 0.6) 50%, transparent 52%),
    radial-gradient(1px 1px at 23% 88%, rgb(255 255 255 / 0.55) 50%, transparent 52%),
    radial-gradient(1px 1px at 69% 77%, rgb(255 255 255 / 0.5) 50%, transparent 52%),
    radial-gradient(1px 1px at 47% 36%, rgb(255 255 255 / 0.45) 50%, transparent 52%);
  background-size: 307px 173px, 307px 173px, 233px 149px, 233px 149px, 307px 173px, 233px 149px, 191px 131px, 191px 131px;
  mask-image: linear-gradient(#000 55%, transparent);
}

.slogan {
  display: block;
  padding-inline: var(--space);
  color: var(--slogan);
  font: 700 clamp(1.6rem, 4.6vw, 3.25rem) / 1.2 var(--font-comic);
  text-shadow: 0 3px 8px rgb(0 0 0 / 0.75);
  text-wrap: balance;
}
.sky-sub {
  display: block;
  margin: 0.25rem 0 clamp(0.5rem, 2vw, 1.25rem);
  padding-inline: var(--space);
  color: var(--text);
  font-size: var(--step-small);
  line-height: 1.5;
  text-shadow: 0 1px 4px #000;
  text-wrap: balance;
}
.building { display: block; width: 100%; max-width: 78rem; height: auto; margin-inline: auto; }

/* ---------- menu ---------- */

.menu { position: relative; z-index: 10; background: var(--panel); border-top: 2px solid var(--amber); border-bottom: 1px solid var(--line); font-family: var(--font-comic); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-list { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; column-gap: clamp(0.5rem, 2.5vw, 2rem); max-width: 78rem; margin-inline: auto !important; }
.menu li { position: relative; }
.menu-row { display: flex; align-items: center; }
.menu a, .menu-row > span { flex: 1; color: var(--text); padding: 0.55rem 0.4rem; line-height: 1.4; }
.menu-list > li > .menu-row > a { font-size: 1.15rem; }
.menu a:hover { color: var(--amber-soft); }
.menu a[aria-current="page"], .menu a.is-current { color: var(--amber); font-weight: 700; }
.menu button { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.menu-open { display: none; }
.sub-open { min-width: 2rem; min-height: 2.75rem; }

.sub { background: #131a2e; }
.sub a { font-size: 0.98rem; }
.sub a[aria-current="page"] { text-decoration: underline; }

@media (min-width: 801px) {
  .sub { display: none; position: absolute; top: 100%; left: 0; width: 18rem; padding: 0.35rem 0.5rem !important; border: 1px solid var(--line); box-shadow: var(--lift); text-align: left; }
  .sub .sub { top: -0.4rem; left: 100%; }
  .menu li:hover > .sub,
  .menu li.open > .sub { display: block; }
  /* Without JavaScript the keyboard still reaches every entry. */
  html:not(.js) .menu li:focus-within > .sub { display: block; }
  .menu-list > li:last-child > .sub { left: auto; right: 0; }
}

@media (max-width: 800px) {
  .js .menu-open { display: block; width: 100%; padding: 0.75rem; color: var(--amber-soft); font-size: 1.15rem; }
  .menu-list { flex-direction: column; }
  .js .menu-list { display: none; }
  .js .menu.open > .menu-list { display: flex; }
  .menu a, .menu-row > span { padding: 0.6rem 1rem; }
  .sub { padding-left: 1rem !important; }
  .js .sub { display: none; }
  .js li.open > .sub { display: block; }
  .sub-open { min-width: 3.5rem; min-height: 2.75rem; font-size: 1.2rem !important; }
}

.content { display: block; min-width: 0; padding: var(--space) var(--space) 4rem; }

/* ---------- reading ---------- */

.entry-header { max-width: var(--measure); margin: 1.75rem auto 1.5rem; text-align: center; }
.entry-header h1 { margin: 0; color: var(--heading); font-size: var(--step-title); line-height: 1.22; letter-spacing: -0.01em; text-wrap: balance; }
.entry-subtitle { margin: 0.5rem 0 0; color: var(--text-soft); text-wrap: balance; }
.entry-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; margin: 0.75rem 0 0; color: var(--text-soft); font-size: var(--step-small); }

.entry-content { max-width: var(--measure); margin: 0 auto; display: flow-root; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 1.8em 0 0.5em; color: var(--amber-soft); line-height: 1.3; text-wrap: balance; }
.entry-content > :first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.35rem; }
.entry-content h3 { font-size: 1.18rem; }
.entry-content h4 { font-size: 1.05rem; }
.entry-content blockquote { margin: 1.25rem 0; padding: 0.1rem 1.25rem; border-left: 1px solid var(--amber-line); color: var(--text-soft); }
.entry-content table { display: block; overflow-x: auto; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.entry-content td, .entry-content th { border: 1px solid rgb(255 255 255 / 0.22); padding: 0.35rem 0.6rem; vertical-align: top; }
.entry-content pre { white-space: pre-wrap; }

.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; hyphens: auto; }
img.align-center { display: block; margin-inline: auto; }

figure { margin: 1.25rem 0; width: fit-content; max-width: 100%; }
figure img { display: block; margin-inline: auto; }
figcaption { max-width: 32rem; margin: 0.35rem auto 0; color: var(--text-soft); font-size: var(--step-small); font-style: italic; text-align: center; }
figure.align-left, img.align-left { float: left; margin: 0.35rem 1.5rem 0.75rem 0; max-width: min(50%, 22rem); }
figure.align-right, img.align-right { float: right; margin: 0.35rem 0 0.75rem 1.5rem; max-width: min(50%, 22rem); }
figure.align-center { margin-inline: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10rem, 100%), 1fr)); gap: 0.6rem; clear: both; margin-block: 1.25rem; }
.gallery figure { margin: 0; width: auto; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.cols { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.col { flex: 1 1 15rem; min-width: 0; }

@media (max-width: 560px) {
  figure.align-left, figure.align-right, img.align-left, img.align-right { float: none; margin: 1rem auto; max-width: 100%; }
  img.align-left, img.align-right { display: block; }
}

/* ---------- post rows: posters alternate right and left ---------- */

.rows { list-style: none; max-width: var(--list-width); margin: 0 auto; padding: 0; }
.year { display: flex; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.year::after { content: ""; flex: 1; height: 1px; background: var(--amber-line); }
.year h2 { margin: 0; color: var(--amber); font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row--left { flex-direction: row-reverse; }
.row-text { flex: 1; min-width: 0; }
.row-text p { margin: 0; }
.row-date { color: var(--amber); font-size: var(--step-small); font-weight: 700; font-variant-numeric: tabular-nums; }
.row h3 { margin: 0.35rem 0 0.75rem; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem); line-height: 1.28; text-wrap: balance; }
.row h3 a { color: var(--heading); }
.row h3 a:hover { color: var(--amber-soft); }
.row-text .row-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; color: var(--text-soft); }
.row-text .row-more { margin-top: 0.9rem; font-size: var(--step-small); }
.row-more a { text-decoration: underline; }

.poster { flex: 0 1 24rem; display: flex; justify-content: center; min-width: 0; }
.row--wide .poster { flex-basis: min(26.25rem, 46%); }
.poster img { display: block; border-radius: 4px; box-shadow: var(--lift); }

.row--text { padding: 1.4rem 0; }
.row--text h3 { margin-bottom: 0.4rem; font-size: 1.25rem; }
.row--text .row-excerpt { max-width: var(--measure); -webkit-line-clamp: 3; }
.row--text .row-more { margin-top: 0.5rem; }

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

/* Phones: one column, the poster above its title. */
@media (max-width: 700px) {
  .row, .row--left { flex-direction: column-reverse; align-items: stretch; gap: 1.1rem; padding: 1.75rem 0; }
  .row--text { padding: 1.25rem 0; }
  .poster, .row--wide .poster { flex: none; }
}

.latest { max-width: var(--list-width); margin: 3.5rem auto 0; }
.latest > h2 { margin: 0; color: var(--heading); font-size: 1.5rem; text-align: center; }
.latest .year h2 { font-size: 1.1rem; }
.latest-all { margin: 1.5rem 0 0; text-align: center; }

/* ---------- titles-only and diary lists ---------- */

.items { list-style: none; max-width: 46rem; margin: 0 auto; padding: 0; }
.item { display: flow-root; margin: 0 0 1.25rem; padding: 1rem 1.25rem; }
.item h2 { margin: 0 0 0.5rem; font-size: 1.2rem; line-height: 1.35; text-wrap: balance; }
.item img { float: left; width: 7.5rem; height: 7.5rem; object-fit: cover; margin: 0 1rem 0.25rem 0; border-radius: 4px; }
.item-excerpt { margin: 0; }
.item-meta { clear: both; display: flex; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 0; font-size: var(--step-small); }

@media (max-width: 480px) {
  .item img { float: none; width: 100%; height: 11rem; margin: 0 0 0.75rem; }
}

.listing-tiles .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 0.75rem; max-width: var(--list-width); }
.listing-tiles .item { display: grid; place-items: center; margin: 0; background: var(--panel); border: 1px solid var(--amber-line); border-radius: 6px; text-align: center; }
.listing-tiles .item h2 { margin: 0; font-size: 1.02rem; }
@media (max-width: 480px) {
  .listing-tiles .items { gap: 0.5rem; }
  .listing-tiles .item { padding: 0.5rem 0.9rem; }
}
.listing-tiles .item a { color: var(--amber-soft); }

/* The residents' diary keeps its own papyrus page, like a sheet under a lamp. */
.listing-journal { max-width: var(--list-width); margin: 1.5rem auto 0; padding: 0.25rem clamp(0.75rem, 3vw, 2.5rem) 1.5rem; background: var(--paper); border-radius: 6px; box-shadow: var(--lift); color: var(--tile-text); color-scheme: light; }
.listing-journal .entry-header, .listing-journal .listing-body { background: rgb(247 245 237 / 0.82); padding: 0.75rem 1.25rem; border-radius: 4px; }
.listing-journal .entry-header h1 { color: var(--tile-link); }
.listing-journal .entry-subtitle, .listing-journal figcaption { color: #2e2a24; }
.listing-journal .listing-body { margin-bottom: 1.25rem; }
.listing-journal .item { background: rgb(247 245 237 / 0.9); border-radius: 4px; }
.listing-journal .item a, .listing-journal .listing-body a { color: var(--tile-link); }
.listing-journal .item-meta { color: #45413a; }
.listing-journal .pager { padding: 0.5rem 0.75rem; background: rgb(247 245 237 / 0.9); border-radius: 4px; color: var(--tile-text); }
.listing-journal .pager a { color: var(--tile-link); }
.listing-journal :focus-visible { outline-color: var(--tile-link); }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; max-width: var(--measure); margin: 2.5rem auto 0; font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.pager a { max-width: 20rem; padding: 0.6rem 0; }

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

.site-footer { background: var(--panel); border-top: 1px solid var(--amber-line); padding: 2.5rem var(--space) 1.5rem; color: var(--text-soft); font-size: var(--step-small); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1.5rem 3rem; max-width: var(--list-width); margin: 0 auto; }
.site-footer h2 { margin: 0 0 0.5rem; color: var(--amber-soft); font-size: 1rem; line-height: 1.3; }
.site-footer p { margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.site-footer li { padding: 0.2rem 0; }
.foot-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); column-gap: 1rem; }
.foot-credits { max-width: var(--list-width); margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line); text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 0.15s ease-out; }
}
