/* ==========================================================================
   aggelakakis.gr — "sheet" layout (inc/layout.php, Customize → Layout → Sheet).

   The whole page, header to footer, is one sheet lying on a coloured background,
   with a soft shadow under it. Inside the sheet the sections touch (no gaps) and
   each takes a different colour from the one before it:
   light sections alternate white / pale blue; dark sections stay petrol (or brick);
   two dark sections in a row step to a deeper petrol so they never merge.
   A section that held a single panel now IS a band of that panel's colour.
   ========================================================================== */

.agk-sheet {
  --agk-sheet-bg: #d6e0e8;
  --agk-sheet-max: 1680px;
  --agk-band-y: clamp(64px, 7vw, 104px);
  --agk-band-x: clamp(24px, 5.5vw, 88px);
  --agk-band-light-a: var(--white);
  --agk-band-light-b: var(--surface);
  --agk-band-deep: #013553;
  background: var(--agk-sheet-bg);
}

/* ------------------------------------------------------------- sheet ---- */

/* div.page: WordPress also puts "page" on the <article> of every page (post_class), which must not become a second sheet. */
.agk-sheet div.page {
  max-width: var(--agk-sheet-max);
  margin: clamp(16px, 2vw, 32px) auto;
  width: calc(100% - 2 * clamp(16px, 2vw, 32px));
  border-radius: 0; /* 0.12.1: square corners everywhere */
  background: var(--white);
  overflow: clip;
  box-shadow:
    0 0 0 1px rgba(2, 40, 62, 0.06),
    0 2px 6px rgba(2, 40, 62, 0.06),
    0 40px 90px -30px rgba(2, 40, 62, 0.45);
}
.agk-sheet .site-header { border-radius: 0; }

@media (max-width: 900px) {
  /* 0.19.0: width too, or the sheet kept 100% - 32px with no margin (a grey strip on the right, 0.6.0–0.18.0). */
  .agk-sheet div.page { width: auto; margin: 0; border-radius: 0; box-shadow: none; }
  .agk-sheet .site-header { border-radius: 0; }
}

/* ------------------------------------------------------------- bands ---- */

/* Every section is a full-width band; nothing floats, nothing is rounded. */
.agk-sheet .entry-content--canvas > .agk-sec.agk-sec,
.agk-sheet .entry-content--canvas > .agk-sec.agk-hero.agk-hero {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  padding: var(--agk-band-y) var(--agk-band-x);
}
.agk-sheet .entry-content--canvas > .agk-sec + .agk-sec { margin-top: 0; }
.agk-sheet .entry-content--canvas > :last-child { margin-bottom: 0; }
.agk-sheet .entry-content--canvas > .agk-sec.agk-hero { padding-top: clamp(80px, 9vw, 136px); }

/* Light bands alternate. Counted among light bands only, so a dark band in between
   does not break the white / pale-blue rhythm. */
.agk-sheet .entry-content--canvas > .agk-sec:nth-child(odd of .agk-sec:not(.agk-hero, .agk-sec--brand, .agk-sec--brick):not(:has(> :is(.agk-panel--brand, .agk-panel--brick):only-child))) {
  background: var(--agk-band-light-a);
}
.agk-sheet .entry-content--canvas > .agk-sec:nth-child(even of .agk-sec:not(.agk-hero, .agk-sec--brand, .agk-sec--brick):not(:has(> :is(.agk-panel--brand, .agk-panel--brick):only-child))) {
  background: var(--agk-band-light-b);
}

/* A section that held one dark panel becomes a dark band; the panel gives up its frame. */
.agk-sheet .entry-content--canvas > .agk-sec:has(> .agk-panel--brand:only-child) { background: var(--brand); color: var(--on-dark-muted); }
.agk-sheet .entry-content--canvas > .agk-sec:has(> .agk-panel--brick:only-child) { background: var(--brand); color: var(--on-dark-muted); } /* 0.15.0: brick is for actions only */
.agk-sheet .entry-content--canvas > .agk-sec > .agk-panel:only-child {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.agk-sheet .entry-content--canvas > .agk-sec--brand { background: var(--brand); }
.agk-sheet .entry-content--canvas > .agk-sec--brick { background: var(--brand); }

/* Two dark bands in a row: the second goes one step deeper so they read as two (brick bands are petrol since 0.15.0). */
.agk-sheet .entry-content--canvas > :is(.agk-hero, .agk-sec--brand, .agk-sec--brick, .agk-sec:has(> :is(.agk-panel--brand, .agk-panel--brick):only-child))
  + :is(.agk-sec--brand, .agk-sec--brick, .agk-sec:has(> :is(.agk-panel--brand, .agk-panel--brick):only-child)) {
  background: var(--agk-band-deep);
}

/* Inside a pale-blue band, light cards stay white with their hairline; inside a white band too. */

/* ------------------------------------------------- home: credentials ---- */

/* Under a full-width hero the strip is its own band: four columns, hairlines between. */
.agk-sheet .agk-creds-strip {
  width: 100%;
  margin: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--agk-line);
  padding: 0 var(--agk-band-x);
}
.agk-sheet .entry-content--canvas > .agk-creds-strip + .agk-sec { margin-top: 0; }
@media (max-width: 560px) {
  .agk-sheet .agk-creds-strip { padding: 0; }
}

/* --------------------------------------------------------- final CTA ---- */

/* The closing panel is the last band before the footer. */
.agk-sheet .agk-final { padding: 0; }
.agk-sheet .agk-final .final-cta {
  max-width: none;
  border-radius: 0;
  padding: var(--agk-band-y) var(--agk-band-x);
}
/* If the page itself ended on a dark band, the closing panel steps deeper. */
.agk-sheet main:has(.entry-content--canvas > :is(.agk-sec--brand, .agk-sec:has(> .agk-panel--brand:only-child)):last-child) .agk-final .final-cta {
  background: var(--agk-band-deep);
}

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

.agk-sheet .site-footer {
  padding-left: var(--agk-band-x);
  padding-right: var(--agk-band-x);
  background: var(--white);
  box-shadow: none;
}

/* ------------------------------------------------- non-canvas pages ---- */

/* Templates with the 360 page hero (archives, posts, search): the hero spans the sheet too. */
.agk-sheet .hero--page { padding: 0; }
.agk-sheet .hero--page .hero__shell { max-width: none; border-radius: 0; }

/* The canvas article's own top margin would leave a white strip under the header. */
.agk-sheet main > .agk-canvas { margin: 0; max-width: none; border-radius: 0; box-shadow: none; }

/* ------------------------------------------------------ detach on scroll ---- */

/* Customize → Layout → "stack the sections" (motion.js marks the bands).
   At rest the bands are one joined sheet: no overlap, no shadow. As a band scrolls
   away it comes loose: it shrinks towards its top edge, rises and fades, and the
   background shows through around it, so the page reads as one piece that is
   being taken apart from the top. The sheet itself is transparent in this mode,
   so what shows through is the page background, not white. */
/* Only on pages whose bands were marked (canvas pages); posts and archives keep the white sheet. */
.agk-stack div.page:has(.agk-card),
.agk-stack div.page:has(.agk-card) > main,
.agk-stack div.page:has(.agk-card) .agk-canvas,
.agk-stack div.page:has(.agk-card) .entry-content--canvas { background: transparent; }
.agk-stack div.page:has(.agk-card) { box-shadow: none; }
.agk-stack [data-panel] {
  position: relative;
  transform-origin: 50% 0;
  box-shadow: 0 30px 70px -40px rgba(2, 40, 62, 0.45);
}
.agk-stack .agk-final.agk-card { padding: 0; }
/* Someone tabbing into a band that has scrolled away brings it straight back. */
.agk-stack [data-panel]:focus-within { opacity: 1 !important; transform: none !important; }
