/* Explore Kerala page. Loaded after css/site.css.

   Each chapter heading gives its name in Malayalam and in English, side by
   side at the same size. Chapters change ground colour so the page reads as
   a run of posters.

   Photos: every .k-photo panel looks for a file in explore-kerala/photos/
   (named in its style attribute). Until that file exists the panel shows its
   Malayalam word as a flat-colour poster, so the page is complete with or
   without the photographs. */

/* ---------- grounds for this page ---------- */
.k-black{background:var(--ink);color:#fff;--text:#fff;--muted:rgba(255,255,255,.84);--line:rgba(255,255,255,.26);--link:var(--sun);--focus:var(--sun);--word:var(--sun);--panel:var(--sun);--panel-word:var(--ink);--panel2:var(--red);--panel2-word:#fff}
.k-white{background:#fff;--word:var(--red);--panel:var(--red);--panel-word:#fff;--panel2:var(--sun);--panel2-word:var(--ink)}
.k-yellow{background:var(--sun);--muted:var(--ink);--line:rgba(5,2,8,.4);--link:var(--ink);--word:var(--ink);--panel:var(--ink);--panel-word:var(--sun);--panel2:var(--red);--panel2-word:#fff}
.k-red{background:var(--red);color:#fff;--text:#fff;--muted:#fff;--line:rgba(255,255,255,.5);--link:#fff;--focus:#fff;--word:var(--sun);--panel:var(--ink);--panel-word:var(--sun);--panel2:var(--sun);--panel2-word:var(--ink)}

/* ---------- opening ---------- */
/* the Kerala artwork behind the title, under a black overlay so the text stays readable */
.k-hero{display:flex;align-items:flex-end;min-height:min(78vh,720px);color:#fff;padding:calc(var(--nav-h) + clamp(2rem,6vw,4.5rem)) var(--gutter) clamp(2.5rem,6vw,4.5rem);overflow:hidden;
  background:linear-gradient(rgba(5,2,8,.72),rgba(5,2,8,.72)),var(--ink) url(photos/kerala-art-bg.jpg) center / cover no-repeat}
.k-hero .wrap{width:100%}
.k-hero .wrap{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem}
.k-hero .ml{font-weight:800;font-size:clamp(5rem,23vw,19rem);line-height:.95;color:var(--sun);margin-left:-.04em;white-space:nowrap}
.k-hero h1{font-size:clamp(2.2rem,5.5vw,4.25rem);line-height:1}
.k-hero p{margin-top:1rem;font-size:clamp(1.2rem,2vw,1.6rem);line-height:1.35;font-weight:500;max-width:36ch}
.k-mural{background:#fff;line-height:0;border-bottom:4px solid var(--ink)}
.k-mural img{width:100%;max-width:1500px;margin:0 auto}

/* ---------- chapter links ---------- */
.k-toc{background:var(--ink);padding:1rem var(--gutter);border-bottom:4px solid var(--sun)}
.k-toc ul{max-width:var(--max);margin:0 auto;display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem .5rem;list-style:none}
.k-toc a{display:block;font-weight:700;color:#fff;text-decoration:none;padding:.35rem .9rem .2rem;border-radius:0;box-shadow:inset 0 0 0 2px rgba(255,255,255,.35)}
.k-toc a:hover{background:var(--sun);color:var(--ink);box-shadow:none}
.k-toc a:focus-visible{outline:3px solid var(--sun);outline-offset:3px}

/* ---------- chapters ---------- */
.k-chapter{padding:clamp(3.5rem,8vw,6.5rem) var(--gutter)}
.k-chapter > .wrap > * + *{margin-top:clamp(2rem,4vw,3rem)}
.k-head h2{font-size:clamp(2.1rem,6.4vw,5rem);line-height:1.05}
/* the chapter name in Malayalam and English, side by side at one size */
.k-head h2 .ml{color:var(--word);white-space:nowrap}
.k-head h2 .sl{font-weight:500;opacity:.55}
.k-head p{margin-top:1rem;font-size:clamp(1.2rem,1.9vw,1.5rem);line-height:1.4;font-weight:500;max-width:46ch}

/* text beside a photo; .flip puts the photo first */
.k-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2rem clamp(2rem,5vw,4.5rem);align-items:center}
.k-row.flip > :first-child{order:2}
@media(max-width:860px){.k-row{grid-template-columns:minmax(0,1fr)}.k-row.flip > :first-child{order:0}}
.k-text > * + *{margin-top:.9em}
.k-text h3{font-size:clamp(1.5rem,2.6vw,2.1rem);line-height:1.08}
.k-text p{color:var(--muted);max-width:62ch}
.k-text p strong{color:var(--text);font-weight:700}

/* ---------- photo panels ---------- */
.k-photo{position:relative;margin:0}
.k-photo .frame{position:relative;display:grid;place-items:center;aspect-ratio:4/3;overflow:hidden;background:var(--panel);border-radius:var(--r)}
.k-photo.wide .frame{aspect-ratio:16/9}
.k-photo.tall .frame{aspect-ratio:4/5}
.k-photo .frame{container-type:inline-size}
.k-photo .frame span{font-weight:800;font-size:12.5cqw;line-height:1.05;color:var(--panel-word);white-space:nowrap}
/* in a row of three, the middle panel takes the second colour */
.k-photos .k-photo:nth-child(2) .frame,.k-row.flip .k-photo .frame{background:var(--panel2)}
.k-photos .k-photo:nth-child(2) .frame span,.k-row.flip .k-photo .frame span{color:var(--panel2-word)}
.k-photo .frame::after{content:"";position:absolute;inset:0;background:var(--photo) center / cover no-repeat}
.k-photo figcaption{margin-top:.55rem;font-size:1rem;line-height:1.35;color:var(--muted)}
.k-photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.5rem}
@media(max-width:860px){.k-photos{grid-template-columns:minmax(0,1fr)}}
/* artwork that is already in the repo */
.k-art img{width:100%;border-radius:var(--r)}

/* ---------- facts in a row ---------- */
.k-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1.5rem 2rem;border-top:3px solid var(--text);padding-top:1.25rem}
.k-facts dt{font-weight:600;color:var(--muted)}
.k-facts dd{font-weight:800;font-size:clamp(2rem,4.4vw,3.5rem);line-height:1}
.k-facts dd span{display:block;font-weight:500;font-size:1.0625rem;line-height:1.35;color:var(--muted);margin-top:.3rem}
@media(max-width:860px){.k-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------- timeline (the history chapter is a real sequence) ---------- */
.k-time{list-style:none;border-top:3px solid var(--text)}
.k-time li{display:grid;grid-template-columns:minmax(0,11rem) minmax(0,1fr);gap:.25rem 2rem;padding:1.1rem 0 1rem;border-bottom:1px solid var(--line)}
.k-time b{font-weight:800;font-size:clamp(1.5rem,2.6vw,2.1rem);line-height:1.05}
.k-time h3{font-size:1.35rem}
.k-time p{margin-top:.2rem;color:var(--muted);max-width:64ch}
@media(max-width:640px){.k-time li{grid-template-columns:minmax(0,1fr)}}

/* ---------- named things: art forms, dishes, books, films, places, people ---------- */
.k-list{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 clamp(1.5rem,3vw,2.5rem);border-top:3px solid var(--text)}
.k-list.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.k-list li{padding:1.1rem 0 1rem;border-bottom:1px solid var(--line)}
.k-list h3,.k-list h4{font-size:1.4rem;line-height:1.1}
.k-list .by{font-weight:700;margin-top:.15rem}
.k-list p{margin-top:.25rem;color:var(--muted)}
@media(max-width:980px){.k-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.k-list,.k-list.two{grid-template-columns:minmax(0,1fr)}}
.k-group{font-size:clamp(1.5rem,2.6vw,2.1rem)}
.k-group + .k-list{margin-top:1rem}

.k-quote{font-weight:800;font-size:clamp(1.7rem,4vw,3rem);line-height:1.1;max-width:22ch}
.k-quote cite{display:block;margin-top:.75rem;font-style:normal;font-weight:600;font-size:1.125rem;line-height:1.4;color:var(--muted)}

/* buttons on the black ground */
.k-black .btn{background:var(--sun);border-color:var(--sun);color:var(--ink)}
.k-black .btn:hover{background:#fff;border-color:#fff;color:var(--ink)}
.k-black .btn-outline{background:transparent;border-color:#fff;color:#fff}
.k-black .btn-outline:hover{background:#fff;color:var(--ink)}

/* ---------- photo credits ---------- */
.k-credits{background:var(--wash);padding:clamp(2.5rem,5vw,3.5rem) var(--gutter)}
.k-credits h2{font-size:1.5rem}
.k-credits p{margin-top:.6rem;color:var(--muted);max-width:70ch}
.k-credits ul{list-style:none;columns:2 22rem;column-gap:3rem;margin-top:1rem;font-size:1rem;line-height:1.45}
.k-credits li{padding:.3rem 0;break-inside:avoid;color:var(--muted)}

/* a row of two photos */
.k-photos.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.k-photos.two .k-photo .frame{aspect-ratio:16/10}
@media(max-width:860px){.k-photos.two{grid-template-columns:minmax(0,1fr)}}

/* ---------- portraits with a name and a line about the person ---------- */
.k-faces{list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1.75rem 1.25rem;margin-top:1.25rem}
.k-faces img{width:100%;aspect-ratio:4/5;object-fit:cover;object-position:50% 18%;border-radius:var(--r);background:var(--panel)}
.k-faces h4{font-size:1.25rem;line-height:1.1;margin-top:.7rem}
.k-faces p{margin-top:.2rem;font-size:1rem;line-height:1.35;color:var(--muted)}
.k-more{color:var(--muted)}
@media(max-width:560px){.k-faces{grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem .9rem}}

/* the leaders: five portraits spanning the full width */
.k-faces.wide{grid-template-columns:repeat(5,minmax(0,1fr));gap:2rem clamp(1rem,2vw,1.75rem)}
.k-faces.wide h4{font-size:clamp(1.25rem,1.8vw,1.6rem)}
.k-faces.wide p{font-size:1.0625rem}
@media(max-width:900px){.k-faces.wide{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.k-faces.wide{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* a portrait slot: shows the name on a colour block until its photo file exists */
.k-face-ph{position:relative;display:grid;place-items:center;aspect-ratio:4/5;overflow:hidden;border-radius:var(--r);background:var(--sun);container-type:inline-size}
.k-face-ph span{font-weight:800;font-size:24cqw;line-height:1;color:var(--ink)}
.k-face-ph::after{content:"";position:absolute;inset:0;background:var(--photo) 50% 18% / cover no-repeat}

/* a list whose items each lead with a photo */
.k-list.pics{border-top:0;gap:2rem clamp(1.5rem,3vw,2.5rem)}
.k-list.pics li{padding:0;border-bottom:0}
.k-list.pics img{width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:var(--r);margin-bottom:.8rem}
