/*
Theme Name: SUMI
Theme URI: https://matthewsumi.com
Author: Matthew Sumi
Description: A minimal, editorial portfolio theme. Includes templates for Portfolio, Case Study, About and Contact, with homepage and footer content editable in the Customizer.
Version: 1.0.2
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: sumi
*/

:root {
  --paper: #f3f5f6; --ink: #172029; --muted: #5d6a75; --rule: #cfd6db;
  --accent: #2837d6; --panel: #e7ebee;
  --wrap: 1120px; --gutter: clamp(1.25rem, 5vw, 3rem);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12181e; --ink: #e8ecef; --muted: #94a1ac; --rule: #2b3640;
    --accent: #8c98ff; --panel: #1b242c;
  }
}
:root[data-theme="dark"] {
  --paper: #12181e; --ink: #e8ecef; --muted: #94a1ac; --rule: #2b3640;
  --accent: #8c98ff; --panel: #1b242c;
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: .5rem .75rem; z-index: 10; }

header { padding: 1.75rem 0; }
header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.mark { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; letter-spacing: -0.01em; }
nav { display: flex; gap: 1.75rem; }
nav a { text-decoration: none; font-size: .975rem; color: var(--muted); padding: .25rem 0;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }

.hero { padding: clamp(4rem, 12vw, 9rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.5rem, 7.2vw, 6rem);
  line-height: 1.04; letter-spacing: -0.025em; margin: 0; max-width: 17ch; text-wrap: balance; }
.hero h1 em { font-style: italic; }
.hero .intro { margin: 2.5rem 0 0; max-width: 46ch; color: var(--muted); font-size: 1.125rem; }
.hero .intro strong { color: var(--ink); font-weight: 600; }

.page-head { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.page-head h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  line-height: 1.06; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.page-head .sub { margin: 1rem 0 0; color: var(--muted); font-size: 1.125rem; max-width: 52ch; }
.crumb { display: inline-block; margin-bottom: 1.5rem; color: var(--muted); font-size: .95rem; text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; }

.work { border-top: 1px solid var(--ink); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 1.25rem 0 1.5rem; }
.section-head h2 { font-family: var(--sans); font-weight: 600; font-size: .975rem; margin: 0; }
.section-head a, .section-head span { color: var(--muted); font-size: .925rem; }
.project { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) auto; gap: 1.5rem 2.5rem;
  align-items: baseline; padding: 2rem 0; border-top: 1px solid var(--rule); text-decoration: none;
  transition: padding-left .3s ease; }
.project:last-child { border-bottom: 1px solid var(--rule); }
.project h3 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.1; letter-spacing: -0.015em; margin: 0; }
.project p { margin: 0; color: var(--muted); max-width: 40ch; }
.project .go { font-size: .925rem; font-weight: 500; color: var(--accent); opacity: 0;
  transform: translateX(-6px); transition: opacity .25s, transform .25s; white-space: nowrap; }
.project:hover, .project:focus-visible { padding-left: 1rem; }
.project:hover h3, .project:focus-visible h3 { color: var(--accent); }
.project:hover .go, .project:focus-visible .go { opacity: 1; transform: none; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(4rem, 9vw, 7rem); }
.card { text-decoration: none; display: block; }
.card .frame { background: var(--panel); overflow: hidden; aspect-ratio: 3 / 2; }
.card .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .frame img { transform: scale(1.025); }
.card h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; margin: 1.1rem 0 .3rem; }
.card:hover h2 { color: var(--accent); }
.card .kind { color: var(--ink); font-weight: 500; font-size: .95rem; margin: 0 0 .35rem; }
.card p { margin: 0; color: var(--muted); max-width: 44ch; }

.case-cover { background: var(--panel); aspect-ratio: 3 / 2; max-height: 70vh; width: 100%; overflow: hidden; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; }
.case-body { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.case-body .lede { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  line-height: 1.25; letter-spacing: -0.01em; max-width: 30ch; margin: 0; }
.next { border-top: 1px solid var(--ink); }
.next .wrap { display: flex; justify-content: space-between; gap: 2rem; padding-top: 1.5rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
.next a { text-decoration: none; max-width: 22rem; }
.next small { display: block; color: var(--muted); font-size: .9rem; margin-bottom: .25rem; }
.next span { font-family: var(--serif); font-weight: 300; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; }
.next a:hover span { color: var(--accent); }
.next a.right { text-align: right; margin-left: auto; }

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 2rem clamp(2rem, 6vw, 5rem); padding-bottom: clamp(4rem, 9vw, 7rem); align-items: start; }
.portrait { background: var(--panel); aspect-ratio: 4 / 5; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-grid .lead { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 2.8vw, 2.125rem); line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 1.5rem; }
.about-grid p { margin: 0 0 1.25rem; max-width: 62ch; color: var(--muted); }
.skills { margin: 2.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.skills li { padding: .8rem 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1.5rem; }
.skills li span:first-child { font-weight: 500; }
.skills li span:last-child { color: var(--muted); text-align: right; font-size: .975rem; }

.contact-main { padding-bottom: clamp(4rem, 9vw, 7rem); }
.mail { font-family: var(--serif); font-size: clamp(1.5rem, 5.4vw, 4rem); font-weight: 300; letter-spacing: -0.02em;
  text-decoration: none; border-bottom: 1px solid currentColor; word-break: break-word; transition: color .2s; }
.mail:hover { color: var(--accent); }
.contact-main .social { margin-top: clamp(2.5rem, 6vw, 4rem); }

.social { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; padding: 0; margin: 0; list-style: none; }
.social a { text-decoration: none; font-size: .975rem; }
.social a:hover { text-decoration: underline; }

.site-footer { background: var(--ink); color: var(--paper); padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.site-footer h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.75rem, 4vw, 3rem); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 1.5rem; max-width: 18ch; }
.site-footer .mail:hover { color: var(--paper); opacity: .7; }
.site-footer a:focus-visible { outline-color: var(--paper); }
.site-footer .social { margin-top: clamp(2.5rem, 6vw, 4rem); }
.site-footer .social a { opacity: .75; }
.site-footer .social a:hover { opacity: 1; }
.fine { margin: 2.5rem 0 0; font-size: .875rem; opacity: .55; }
.light-footer { padding: 0 0 2.5rem; color: var(--muted); }
.light-footer .fine { margin: 0; opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .home .hero h1 { animation: settle 1s cubic-bezier(.2,.7,.2,1) both; }
  .home .hero .intro { animation: fade .9s .45s ease both; }
  @keyframes settle { from { opacity: 0; letter-spacing: .01em; } to { opacity: 1; letter-spacing: -0.025em; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project, .project .go, .card .frame img { transition: none; }
}
@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; gap: .6rem; padding: 1.6rem 0; }
  .project .go { display: none; }
  .project:hover, .project:focus-visible { padding-left: 0; }
  .cards { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 22rem; }
  .skills li { flex-direction: column; gap: .15rem; }
  .skills li span:last-child { text-align: left; }
  nav { gap: 1.1rem; }
  .next .wrap { flex-direction: column; }
  .next a.right { text-align: left; margin-left: 0; }
}

/* ---------- WordPress additions ---------- */
nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
nav li { margin: 0; }
nav li.current-menu-item > a, nav li.current_page_item > a { color: var(--ink); border-color: var(--ink); }
.spacer { height: clamp(4rem, 9vw, 7rem); }
.page-body { padding-bottom: clamp(4rem, 9vw, 7rem); }
.screen-reader-text { position: absolute; left: -9999px; }
.entry { max-width: 68ch; }
.entry > *:first-child { margin-top: 0; }
.entry p, .entry ul, .entry ol { color: var(--muted); }
.entry h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; margin: 2.5rem 0 .75rem; color: var(--ink); }
.entry h3 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; margin: 2rem 0 .5rem; color: var(--ink); }
.entry a { color: var(--accent); }
.entry img, .entry video { max-width: 100%; height: auto; }
.entry figure { margin: 2rem 0; }
.entry figcaption, .wp-caption-text { color: var(--muted); font-size: .9rem; margin-top: .5rem; }
.entry blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 2px solid var(--accent); font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; }
.entry .wp-block-image img, .entry .wp-block-video video { width: 100%; }
.case-body .entry { margin-top: 2.5rem; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.nav-links { display: flex; gap: 1rem; padding-top: 2rem; }
.nav-links a, .nav-links span { text-decoration: none; }
.about-grid .entry p { max-width: 62ch; }
@media (max-width: 760px) {
  nav ul { gap: 1.1rem; }
}

/* Portfolio: grid spans exactly the header width (SUMI. to Contact) */
.wrap.cards { width: 100%; max-width: var(--wrap); padding-left: var(--gutter); padding-right: var(--gutter); margin-left: auto; margin-right: auto; }
.cards .card { min-width: 0; }
.cards .card .frame img { width: 100%; }

/* If a page still carries Elementor content, stretch it to the same width */
.page-template-template-portfolio .elementor-section.elementor-section-boxed > .elementor-container,
.page-template-template-portfolio .e-con.e-con-boxed > .e-con-inner { max-width: var(--wrap); width: 100%; }
.page-template-default .entry .elementor-section.elementor-section-boxed > .elementor-container { max-width: none; }

/* About and Contact: text only, no photos */
.about-grid { display: block; }
.about-grid > div { max-width: 46rem; }
.page-template-template-about .entry img,
.page-template-template-about .entry figure,
.page-template-template-contact .entry img,
.page-template-template-contact .entry figure,
.page-template-template-contact .entry .wp-block-image { display: none; }
