/*
Theme Name: Mom
Theme URI: https://neldatravis.com/
Author: Mark Travis
Author URI: https://mark-travis.com/
Description: A quiet tribute site for Nelda Hernandez Travis: her portrait, her name and dates, her zebra ribbon and her obituary on the home page, and a Photos page. Lavender and plum, set in Mots.
Version: 1.03
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mom
*/

/* ---------- Type: Mots and Mots Caps (in /fonts) ---------- */
@font-face { font-family: "Mots"; src: url("fonts/mots-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mots"; src: url("fonts/mots-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Mots"; src: url("fonts/mots-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Mots Caps"; src: url("fonts/mots-caps-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
	--paper: #f6f2fa;     /* lavender paper */
	--card: #ffffff;
	--plum: #3a2747;      /* text */
	--lavender: #7a5aa6;  /* her color: the middle name, the drop cap, links on hover */
	--soft: #6c5a80;      /* dates, captions, the footer (5.6:1 on the paper) */
	--line: #ddd2ec;
	--rule: #cbbbe0;
	--wash: #e6dcf2;
	--display: "Mots", Georgia, serif;
	--caps: "Mots Caps", "Mots", Georgia, serif;
	--text: "Mots", Georgia, serif;
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--plum); font: 400 1.2rem/1.6 var(--text); }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .2s; }
a:hover { color: var(--lavender); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 4px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 100; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: .6rem 1rem; background: var(--plum); color: var(--card); text-decoration: none; }
.wrap { width: 100%; max-width: 69rem; margin: 0 auto; padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
main { flex: 1 0 auto; }

/* ---------- The menu: her first name and Photos, centered ---------- */
.nav { padding-block: 1.6rem; }
.nav ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2rem 2.4rem; margin: 0; padding: 0; list-style: none; }
.nav li { display: flex; align-items: center; gap: 2.4rem; }
.nav li + li::before { content: ""; width: 5px; height: 5px; margin-left: -1.2rem; margin-right: -1.2rem; border-radius: 50%; background: var(--lavender); opacity: .7; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; font: 400 1.05rem/1 var(--caps); letter-spacing: .2em; text-transform: lowercase; text-decoration: none; }
.nav a[aria-current="page"], .nav .current-menu-item > a { color: var(--lavender); }

/* ---------- Home: portrait, name, dates, ribbon, obituary ---------- */
.tribute { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 2.6rem 5rem; }
.tribute__photo { width: 19rem; max-width: 78vw; margin: 0; padding: .75rem; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 22px 50px rgba(74, 48, 104, .16); }
.tribute__photo img, .tribute__photo .tribute__photo-empty { display: block; width: 100%; aspect-ratio: 25 / 32; object-fit: cover; object-position: var(--focus, 50%) 30%; border-radius: 999px; background: var(--wash); }
.tribute__photo-empty { display: flex !important; align-items: center; justify-content: center; padding: 2rem; color: var(--soft); font-style: italic; font-size: 1rem; line-height: 1.4; }
.name { margin: 3.4rem 0 0; font: 400 clamp(2.8rem, 7vw, 5rem)/1.02 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.name i { font-style: italic; font-weight: 400; color: var(--lavender); }
.dates { margin: 1.3rem 0 0; font: 400 clamp(1rem, 1.7vw, 1.25rem)/1.5 var(--caps); letter-spacing: .2em; text-transform: lowercase; color: var(--soft); }
.dates__part { white-space: nowrap; }
.ribbon { display: flex; align-items: center; gap: 1.1rem; margin: 2.8rem 0 0; }
.ribbon::before, .ribbon::after { content: ""; width: 5.6rem; height: 1px; background: var(--rule); }
.ribbon svg { display: block; width: 30px; height: 48px; }

/* the obituary: the home page's own text */
.story { max-width: 39rem; margin: 2.8rem auto 0; text-align: left; font-size: 1.3rem; line-height: 1.6; overflow-wrap: break-word; }
.story > p:first-of-type::first-letter { float: left; margin: 0; padding: .07em .1em 0 0; font: 400 4.7em/.78 var(--display); color: var(--lavender); }
.story p { margin: 0 0 1.1em; }
/* the end mark: her zebra ribbon after the obituary's last word */
.tribute .story > p:last-of-type::after { content: ""; display: inline-block; width: .8em; height: 1.28em; margin-left: .4em; vertical-align: -.26em; background: url("images/ribbon.svg") center / contain no-repeat; }
.story h2, .story h3 { margin: 2em 0 .5em; font: 400 2rem/1.1 var(--display); }
.story h3 { font-size: 1.6rem; font-style: italic; }
.story blockquote { margin: 1.6em 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--rule); font-style: italic; color: var(--soft); }
.story ul, .story ol { padding-left: 1.3em; }
.story hr { width: 30%; margin: 2.4em auto; border: 0; border-top: 1px solid var(--rule); }
.story img { border-radius: 4px; }
.story .alignleft { float: left; margin: .3rem 1.4rem .8rem 0; }
.story .alignright { float: right; margin: .3rem 0 .8rem 1.4rem; }
.story .aligncenter { display: block; margin-inline: auto; }
.story .wp-caption { max-width: 100%; }
.story .wp-caption-text, .story figcaption { margin-top: .4rem; font-size: 1rem; font-style: italic; color: var(--soft); }
.story::after { content: ""; display: table; clear: both; }

/* ---------- Other pages (Photos and any page added later) ---------- */
.page-head { text-align: center; padding-block: 2.4rem 1rem; }
.page-head h1 { margin: 0; font: 400 clamp(2.6rem, 6vw, 4.2rem)/1 var(--display); letter-spacing: -.02em; }
.page-head p { max-width: 34rem; margin: 1.1rem auto 0; color: var(--soft); font-style: italic; }
.page-body { padding-block: 1.6rem 5rem; }
.page-body .story { margin-top: 0; }
.page-body .story > p:first-of-type::first-letter { float: none; margin: 0; font: inherit; color: inherit; }

/* ---------- Photos: the gallery as soft masonry, each photo opening large ---------- */
.photos .gallery, .photos .wp-block-gallery { display: block; columns: 3 16rem; column-gap: 1.2rem; margin: 0; }
.photos .gallery br { display: none; }
.photos .gallery-item, .photos .wp-block-image { display: block; width: auto !important; max-width: none !important; margin: 0 0 1.2rem !important; break-inside: avoid; text-align: center; }
.photos .gallery-icon img, .photos .wp-block-image img { display: block; width: 100%; height: auto; padding: .5rem; background: var(--card); border: 0 !important; border-radius: 3px; box-shadow: 0 0 0 1px var(--line), 0 10px 26px rgba(74, 48, 104, .10); transition: transform .25s, box-shadow .25s; }
.photos .gallery-icon a:hover img, .photos .gallery-icon a:focus-visible img { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--lavender), 0 16px 34px rgba(74, 48, 104, .16); }
.photos .gallery-caption, .photos .wp-element-caption { margin: .5rem .4rem 0; font-size: 1rem; font-style: italic; color: var(--soft); line-height: 1.4; }
.photos .story { max-width: none; }
.photos .story > p { max-width: 39rem; margin-inline: auto; }

/* the large view (js/mom.js) */
.viewer { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(32, 22, 40, .94); color: #f3ecfa; }
.viewer::backdrop { background: transparent; }
.viewer__figure { position: absolute; inset: 0; margin: 0; padding: 4.5rem 4.5rem 5.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.viewer__cap { max-width: 40rem; text-align: center; font-style: italic; color: #d9cde8; }
.viewer button { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(243, 236, 250, .35); border-radius: 50%; background: rgba(58, 39, 71, .5); color: inherit; font: 400 1.5rem/1 var(--display); cursor: pointer; }
.viewer button:hover, .viewer button:focus-visible { background: var(--lavender); border-color: var(--lavender); }
.viewer__close { top: 1rem; right: 1rem; }
.viewer__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.viewer__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.viewer__count { position: absolute; left: 0; right: 0; bottom: 1.4rem; text-align: center; font: 400 .95rem/1 var(--caps); letter-spacing: .2em; color: #cbbde0; }
@media (max-width: 640px) {
	.viewer__figure { padding: 4rem .75rem 6rem; }
	.viewer__prev, .viewer__next { top: auto; bottom: .8rem; transform: none; }
	.viewer__count { bottom: 2.2rem; }
}

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 2rem; text-align: center; font-size: 1rem; color: var(--soft); }
.foot p { margin: 0; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
	body { font-size: 1.125rem; }
	.nav { padding-block: 1rem; }
	.nav ul, .nav li { gap: .2rem 1.6rem; }
	.nav li + li::before { margin-inline: -.8rem; }
	.tribute { padding-block: 1.4rem 3.5rem; }
	.name { margin-top: 2.4rem; }
	.dates { letter-spacing: .2em; }
	.ribbon::before, .ribbon::after { width: 3.6rem; }
	.story { font-size: 1.2rem; }
	.photos .gallery, .photos .wp-block-gallery { columns: 2 9rem; column-gap: .8rem; }
	.photos .gallery-item, .photos .wp-block-image { margin-bottom: .8rem !important; }
	.photos .gallery-icon img, .photos .wp-block-image img { padding: .3rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .nav, .foot, .ribbon { display: none; } body { background: #fff; } }
