/*
Theme Name: Matthew Connors Photography
Author: Matthew Connors
Description: Photography portfolio with a full-screen entry page, filterable gallery, full-size viewer and a links page. Photos are managed from the Photos menu in the dashboard.
Version: 1.0.0
Requires at least: 6.0
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: mcp-photography
*/

:root {
  --bg: #e9e9e7;
  --panel: #f7f7f6;
  --ink: #1d1d1c;
  --mute: #666663;
  --line: #cdcdc9;
  --on-ink: #f4f4f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --panel: #1d1d1c;
    --ink: #e9e9e6;
    --mute: #9a9a96;
    --line: #313130;
    --on-ink: #141413;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.1rem/1.65 Newsreader, Georgia, serif;
}
nav, h1, h2, .filters button, .btn, .meta, .foot, .linklist a {
  font-family: Jost, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 8px 12px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Navigation */
nav { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 22px 0; }
nav .brand { font-size: 1.3rem; font-weight: 500; letter-spacing: .01em; text-decoration: none; }
nav .links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
nav .links a { text-decoration: none; color: var(--mute); }
nav .links a:hover { color: var(--ink); }

/* Headings and intro */
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.05; font-weight: 500; letter-spacing: -.02em; margin: 40px 0 16px; max-width: 18ch; }
h2 { font-size: 1.9rem; font-weight: 500; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
.lede { max-width: 52ch; color: var(--mute); margin: 0 0 8px; font-size: 1.2rem; }

/* Entry page */
.entry {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: #f4f4f2;
  background: #111 center / cover no-repeat;
  padding: 0 20px calc(48px + env(safe-area-inset-bottom, 0px));
}
.entry::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 10, 10, .85), rgba(10, 10, 10, .1) 65%); }
.entry-in { position: relative; max-width: 1180px; margin: 0 auto; width: 100%; }
.entry h1 { margin: 0 0 14px; font-size: clamp(2.4rem, 7vw, 5rem); max-width: none; }
.entry p { max-width: 44ch; margin: 0 0 28px; color: #e3e3e0; font-size: 1.2rem; }
.btn { display: inline-block; font-size: 1rem; font-weight: 500; padding: 12px 24px; background: var(--ink); color: var(--on-ink); text-decoration: none; }
.entry .btn { background: #f4f4f2; color: #141413; margin: 0 10px 10px 0; }
.entry .btn.ghost { background: transparent; color: #f4f4f2; border: 1px solid #ffffff88; }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 40px 0 22px; border-bottom: 1px solid var(--line); }
.filters button { font-size: 1rem; font-weight: 500; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--mute); cursor: pointer; margin-bottom: -1px; }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 18px; margin: 0 0 80px; padding: 0; list-style: none; }
.sheet .open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.sheet img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--panel); }
.meta { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--mute); padding-top: 8px; }
.meta span:first-child { color: var(--ink); }

/* About, contact */
.about { display: grid; gap: 20px; padding: 52px 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .about { grid-template-columns: 1fr 1.5fr; gap: 56px; } }
.about p { margin: 0 0 1em; max-width: 60ch; }

/* Links page */
.linklist { list-style: none; padding: 0; margin: 32px 0 80px; max-width: 680px; }
.linklist a { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: 1.3rem; }
.linklist a:hover { color: var(--mute); }
.linklist span { color: var(--mute); font-weight: 400; font-size: 1rem; }

/* Single photo, plain pages */
.single-photo img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; background: var(--panel); }
.single-photo .meta { font-size: 1rem; padding: 12px 0 0; }
.plain { padding-bottom: 80px; }
.plain .content { max-width: 62ch; }

/* Footer */
.foot { padding: 28px 0 48px; color: var(--mute); font-size: .9rem; border-top: 1px solid var(--line); }

/* Full-size viewer */
dialog { border: 0; padding: 0; background: transparent; max-width: min(94vw, 1200px); width: 100%; color: #f1f1ef; overflow: visible; }
dialog::backdrop { background: rgba(10, 10, 10, .92); }
.lb-img { display: block; margin: 0 auto; max-width: 100%; max-height: 78vh; object-fit: contain; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; font-family: Jost, sans-serif; }
.lb-bar button { font: 500 .95rem Jost, sans-serif; padding: 8px 14px; border: 1px solid #ffffff55; background: #ffffff14; color: #fff; cursor: pointer; }
