/*
Theme Name:   Raytcho Memorial
Theme URI:    https://raytcholazarov.com
Author:       Built for the Lazarov family
Description:  The design of raytcholazarov.com as a WordPress theme — cream paper, gold rules, madder and forest green, PT Serif and Lora, and the БГ/EN toggle that carries the whole site in two languages. Pairs with the Raytcho Memories plugin.
Version:      1.0.4
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  raytcho
*/

/* The system itself lives in assets/system.css and is lifted verbatim from
   the built static site, so the two versions cannot drift apart. This file
   holds only what WordPress adds: the shape of an editor-written page, and
   the pieces the static site had no need for. */

/* ---------------------------------------------------------------------------
   THE CLASS COLLISION THAT FROZE EVERY PAGE  (26 August 2026)

   system.css carries the document frame:

       .page{margin:var(--gutter);border:1px solid var(--frame);
             position:relative;background:var(--paper);overflow:hidden}

   which is written for <div class="page"> in header.php. But WordPress's own
   body_class() puts the class "page" on <body> for every Page it renders:

       <body class="wp-singular page-template-default page page-id-106 …">

   So <body> matched .page too and inherited overflow:hidden. When <html> is
   overflow:visible, the browser takes the viewport's overflow from <body> —
   so the whole site could not be scrolled. The pages were complete and full
   height (a chapter measured 45,599px); the viewport simply refused to move.

   It looked like truncation, which is what sent the last session after the
   home page's size. The two are unrelated. The tell: the blog index scrolled
   fine, because body_class() writes "blog" there, not "page".

   Do not fix this in system.css — that file is lifted verbatim from the
   static site and must not drift. Undo the accidental match here instead.
   --------------------------------------------------------------------------- */
body.page{margin:0;border:0;position:static;overflow:visible}

/* A page that brings the static site's own <section>s (see page.php). Those
   sections carry their own vertical rhythm and their own inner .wrap, so the
   theme must add neither — any padding here shows up as a gap above the
   banner, and any width limit clips it. */
.entry-bleed{padding:0}

/* PHOTOGRAPHS AT THEIR OWN SIZE AND SHAPE, 27 August 2026.

   TWO faults, and the first fix only caught the smaller one.

   1. UPSCALING. figure.ph.land img{width:100%} blows every landscape
      photograph up to the full column whatever its real size — a 499×377
      scan stretched to 578 px goes soft. Shape is right, sharpness is not.

   2. SQUASHING, which is the one Dora kept seeing. figure.ph img carries
      max-width:100% and figure.ph.portrait img carries max-height:560px.
      When only ONE of those binds, the browser scales proportionally and
      all is well. When BOTH bind — a portrait wider than the column AND
      taller than 560 px — it clamps each axis independently and the
      photograph is genuinely squashed. Measured on the live site:
      768×1024 rendered as 578×550, an aspect error of 0.30.

      That is exactly why some chapters looked fine and others did not.
      Средни Колиби's portraits are small (180×240, 462×1000) so only one
      cap binds; Родителите ми has ten portraits where both do, and all ten
      were distorted. Nothing to do with which chapter it was.

   Declaring width and height explicitly auto restores the proportional
   min/max sizing for both cases at once. Verified by measuring every
   photograph on three chapters before and after: distortion and upscaling
   both go to zero, and the landscape photographs are unaffected.

   The static site carries the same two rules in a wider column, so it has
   the same faults, harder. Fixing it there means editing sixteen built
   pages — after Borovets, not days before it. */
.entry figure.ph img{width:auto;height:auto}

.entry{padding:56px 0}
.entry .wrap>h1{font-size:clamp(2rem,4.6vw,3rem);margin-bottom:22px}
.entry p{max-width:38em;color:var(--ink-soft)}
.entry h2{margin:38px 0 14px}
.entry h3{margin:28px 0 10px;font-size:1.2rem}
.entry ul,.entry ol{max-width:38em;color:var(--ink-soft)}
.entry img{max-width:100%;height:auto}
.entry blockquote{
  margin:26px 0;padding:2px 0 2px 22px;border-left:3px solid var(--gold);
  font-family:var(--display);font-style:italic;font-size:1.12rem;color:var(--ink);
}
.entry a{color:var(--madder)}

/* WordPress's own alignment classes, so the editor behaves */
.alignleft{float:left;margin:6px 24px 12px 0}
.alignright{float:right;margin:6px 0 12px 24px}
.aligncenter{display:block;margin-left:auto;margin-right:auto}
.wp-caption-text,.wp-element-caption{
  font-family:var(--mono);font-size:11.5px;color:var(--moss-soft);margin-top:8px;
}
.screen-reader-text{
  position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);
}
.skip-link:focus{
  position:fixed;left:14px;top:14px;z-index:99;background:var(--card);
  padding:10px 16px;border:1px solid var(--frame);color:var(--ink);
}
