/*
Theme Name: Markiewicz Photography
Theme URI: https://example.com/
Description: A quiet, photo-book child theme for the Genesis Framework. Single typeface, paper background, full-width vertical photo scroll. Built for documentary photography and film.
Author: Stefan Markiewicz
Author URI: https://example.com/
Version: 1.0.8
Template: genesis
Text Domain: sm-photography
Tags: photography, minimal, one-column, custom-logo, custom-menu, editor-style, featured-images
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 6.0
Requires PHP: 7.4
*/

/* ═══════════════════════════════════════════════════════════
   1. Typeface — one family only, self-hosted, three files
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ═══════════════════════════════════════════════════════════
   2. Foundations
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #f6f3ec;
  --ink: #2b2825;
  --muted: #8b8378;
  --rule: #e3ddd0;
  --measure: 34rem;
  --page: min(92vw, 80rem);
}

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

html {
  font-size: 17px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A whisper of grain — reads as paper, not as an effect. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.15 0 0 0 0 0.13 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

/* Accessibility: Genesis skip links, visible on focus only. */
.screen-reader-shortcut,
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.screen-reader-shortcut:focus,
.screen-reader-text:focus {
  position: static !important;
  width: auto;
  height: auto;
  clip: auto;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
}

/* ═══════════════════════════════════════════════════════════
   3. Header — signature left, navigation right
   ═══════════════════════════════════════════════════════════ */

.site-header {
  position: relative;
  z-index: 3;
}

.smp-bar {
  width: var(--page);
  margin: 0 auto;
  padding: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.site-title img,
.site-title .custom-logo {
  display: block;
  width: auto;
  height: 2.4rem;
}

.site-description {
  display: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-parent > a,
.site-nav [aria-current='page'] {
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════
   4. Page container
   ═══════════════════════════════════════════════════════════ */

.site-inner {
  flex: 1 0 auto;
  width: var(--page);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

.content-sidebar-wrap,
.content {
  width: 100%;
}

.site-footer {
  width: var(--page);
  margin: 0 auto;
  padding: 0 0 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   5. Entry headings — album and page titles
   ═══════════════════════════════════════════════════════════ */

.entry-header {
  max-width: var(--measure);
  margin-bottom: 4rem;
}

.entry-title {
  font-size: 1.9rem;
}

.entry-title a {
  color: inherit;
}

.smp-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.smp-caption {
  margin: 1.25rem 0 0;
  font-style: italic;
}

/* Genesis post info/meta are unhooked in functions.php; hidden here as a
   belt-and-braces measure in case a plugin puts them back. */
.entry-meta {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   6. Content — text stays narrow, pictures go wide
   ═══════════════════════════════════════════════════════════ */

.entry-content > * {
  max-width: var(--measure);
  margin-top: 0;
  margin-bottom: 1.4em;
}

.entry-content > p:last-child {
  margin-bottom: 0;
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--muted);
}

.entry-content h2 {
  font-size: 1.3rem;
  margin-top: 2.5em;
}

.entry-content blockquote {
  margin-left: 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
  font-style: italic;
}

/* Anything visual escapes the text measure. */
.entry-content > figure,
.entry-content > .wp-block-image,
.entry-content > .wp-block-gallery,
.entry-content > .wp-block-embed,
.entry-content > .wp-block-video,
.entry-content > .alignwide,
.entry-content > .alignfull {
  max-width: none;
}

/* ═══════════════════════════════════════════════════════════
   7. The photo-book scroll
   A gallery block becomes one vertical column of large images.
   ═══════════════════════════════════════════════════════════ */

.entry-content .wp-block-gallery,
.entry-content .wp-block-gallery.has-nested-images {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vh, 7rem);
  margin: clamp(3rem, 8vh, 7rem) 0;
  padding: 0;
  list-style: none;
}

/* Override the core gallery grid: every image is its own full-width row. */
.entry-content .wp-block-gallery .wp-block-image,
.entry-content .wp-block-gallery figure.wp-block-image {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  flex-basis: auto !important;
  flex-grow: 0 !important;
}

.entry-content .wp-block-gallery figure.wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Standalone images between paragraphs behave the same way. */
.entry-content > .wp-block-image {
  margin: clamp(3rem, 8vh, 7rem) 0;
}

.entry-content > .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Portrait frames shouldn't tower on a desktop screen. The attribute is added
   automatically by the theme when a photograph is taller than it is wide. */
.entry-content img[data-portrait] {
  width: min(100%, 44rem);
  margin-left: auto;
  margin-right: auto;
}

/* Image captions, when used. */
.entry-content figcaption,
.entry-content .wp-element-caption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  text-align: left;
}

/* The single permitted animation: a soft fade as each photograph arrives.
   Applies everywhere photographs appear — albums, the home page, the index. */
img[data-fade] {
  opacity: 0;
  transition: opacity 0.8s ease;
}

img[data-fade].is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  img[data-fade] {
    transition: none;
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   7b. Lightbox — WordPress's own "expand on click"
   ═══════════════════════════════════════════════════════════ */

/* The lightbox renders its own copy of the photograph. That copy inherits the
   fade attribute, so pin it visible — it must never depend on our script. */
.wp-lightbox-overlay img[data-fade] {
  opacity: 1 !important;
}

/* Open onto paper rather than the default white. */
.wp-lightbox-overlay .scrim {
  background-color: var(--paper) !important;
}

/* Only photographs that actually open get the zoom cursor — an image with
   "Expand on click" switched off keeps a normal pointer. */
.entry-content .wp-lightbox-container img {
  cursor: zoom-in;
}

/* ═══════════════════════════════════════════════════════════
   8. Film — Vimeo embeds
   ═══════════════════════════════════════════════════════════ */

.entry-content .wp-block-embed {
  margin: 0 0 5rem;
}

.entry-content .wp-block-embed:last-child {
  margin-bottom: 0;
}

.entry-content .wp-block-embed__wrapper {
  position: relative;
}

.entry-content .wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper::before {
  padding-top: 56.25%;
}

.entry-content .wp-block-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  background: var(--rule);
}

.entry-content .wp-block-embed figcaption {
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════
   9. Travel index — the album list
   ═══════════════════════════════════════════════════════════ */

.album-index {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vh, 5.5rem);
}

.album-card a {
  display: block;
}

.album-cover {
  display: block;
  margin-bottom: 1.15rem;
}

.album-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.album-card a:hover .album-cover img,
.album-card a:focus .album-cover img {
  opacity: 0.88;
}

.album-text {
  display: block;
  max-width: var(--measure);
}

.album-name {
  display: block;
  font-size: 1.3rem;
  line-height: 1.2;
}

.album-where {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.album-note {
  display: block;
  margin-top: 0.6rem;
  font-style: italic;
}

.smp-empty {
  color: var(--muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   10. Home
   ═══════════════════════════════════════════════════════════ */

.smp-home .smp-intro,
.smp-home .smp-intro p {
  max-width: var(--measure);
  font-size: 1.15rem;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.smp-home .smp-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0 0 4rem;
  padding: 0;
  list-style: none;
}

.smp-home .smp-links a {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease;
}

.smp-home .smp-links a:hover,
.smp-home .smp-links a:focus {
  border-color: var(--ink);
}

.smp-home .smp-hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════
   11. Small screens
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  :root {
    --page: 92vw;
  }

  .site-inner {
    padding-top: 2rem;
  }

  .entry-header {
    margin-bottom: 2.5rem;
  }

  .entry-title {
    font-size: 1.6rem;
  }

  .entry-content .wp-block-gallery,
  .entry-content .wp-block-gallery.has-nested-images {
    gap: 2.5rem;
    margin: 2.5rem 0;
  }

  .entry-content > .wp-block-image {
    margin: 2.5rem 0;
  }

  .album-index {
    gap: 2.75rem;
  }

  .album-name {
    font-size: 1.2rem;
  }

  .smp-home .smp-links ul {
    margin-bottom: 2.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   12. Print
   ═══════════════════════════════════════════════════════════ */

@media print {
  body::before,
  .site-nav,
  .site-footer {
    display: none;
  }
}
