/*
Theme Name: Michael Liebhaber Portfolio
Theme URI: https://www.mjliebhaber.com/
Author: Michael Liebhaber
Description: Public portfolio theme matching the Michael Liebhaber artwork site design. Uses regular posts as paintings, ACF for artwork metadata, and a collection taxonomy with drag-and-drop gallery order.
Version: 0.1.0
Text Domain: mjliebhaber
*/

:root {
  --bg: #fdfcf9;
  --panel: #ffffff;
  --text: #20211f;
  --muted: #6f726a;
  --line: #deded7;
  --soft: #f5f4ef;
  --accent: #7c2230;
  --accent-dark: #551620;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Source Sans 3", Arial, Helvetica, sans-serif;
  --base-font-size: 16px;
  --heading-max-size: 72px;
  --logo-width: 189px;
  --sidebar-width: 260px;
  --sidebar-gap: 10px;
  --outer-margin: clamp(24px, 5vw, 92px);
  --artwork-title-height: 72px;
  --gallery-desktop-columns: 3;
  --gallery-column-gap: 38px;
  --gallery-row-gap: 56px;
  --gallery-desktop-gap-total: 76px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
}

body {
  background: var(--bg);
  font-size: var(--base-font-size);
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration-color: rgba(124, 34, 48, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  background: transparent;
  padding: 42px var(--outer-margin) 34px;
}

.site-logo-link {
  background: transparent;
  display: inline-block;
}

.site-logo {
  background: transparent;
  height: auto;
  width: var(--logo-width);
}

.site-main {
  margin-left: var(--outer-margin);
  margin-right: calc(var(--outer-margin) + var(--sidebar-width) + var(--sidebar-gap));
  min-height: calc(100vh - 190px);
  padding: 10px 0 86px;
}

.side-menu {
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.01em;
  line-height: 1.55;
  padding-left: 24px;
  position: fixed;
  right: var(--outer-margin);
  top: 150px;
  width: var(--sidebar-width);
  z-index: 10;
}

.side-menu-heading {
  color: var(--text);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}

.side-menu-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.side-menu-list li {
  margin: 0 0 8px;
}

.side-menu a {
  text-decoration: none;
}

.side-menu a:hover {
  text-decoration: underline;
}

.side-menu-sublist {
  margin-bottom: 30px;
  padding-left: 2ch;
}

.side-menu-sublist a {
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 14.5px;
  gap: 20px;
  justify-content: space-between;
  margin: 20px var(--outer-margin) 0;
  padding: 28px 0 42px;
}

.site-footer p {
  margin: 0;
}

.home-standard-page {
  background: var(--bg);
  min-height: 100vh;
}

.home-standard-main {
  margin-right: calc(var(--outer-margin) + var(--sidebar-width) + 20px);
}

.home-standard-showcase {
  width: 100%;
}

.home-standard-image {
  display: block;
  width: 100%;
}

.home-standard-image img {
  box-shadow: 0 20px 50px rgba(32, 33, 31, 0.08);
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: left top;
  width: 100%;
}

.home-standard-caption {
  max-width: 720px;
  padding: 28px 0 0;
}

.home-standard-caption h1 {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(36px, 4vw, var(--heading-max-size));
  line-height: 0.98;
  margin: 0 0 14px;
}

.home-standard-caption h1 a {
  text-decoration: none;
}

.page-heading {
  margin-bottom: 38px;
  max-width: 880px;
}

.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.section-kicker a {
  text-decoration: none;
}

.artwork-detail-copy h1,
.page-heading h1,
.content-page h1 {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(40px, 4.6vw, var(--heading-max-size));
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 0.94;
  margin: 0 0 22px;
}

.collection-notes {
  border-top: 1px solid var(--line);
  margin: -12px 0 clamp(44px, 6vw, 72px);
  max-width: 760px;
  padding-top: 26px;
}

.collection-notes .entry-content {
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.65;
}

.gallery-section {
  width: 100%;
}

.artwork-grid {
  --gallery-columns: var(--gallery-desktop-columns);
  --gallery-gap-total: var(--gallery-desktop-gap-total);
  align-items: stretch;
  display: grid;
  gap: var(--gallery-row-gap) var(--gallery-column-gap);
  grid-template-columns: repeat(var(--gallery-columns), calc((100% - var(--gallery-gap-total)) / var(--gallery-columns)));
}

.artwork-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto var(--artwork-title-height);
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.artwork-thumb {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: clamp(16px, 2vw, 28px);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
  width: 100%;
}

.artwork-thumb:hover {
  background: #ffffff;
  border-color: rgba(222, 222, 215, 0.9);
  box-shadow: 0 18px 42px rgba(32, 33, 31, 0.07);
}

.artwork-thumb img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.artwork-thumb-placeholder {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.artwork-card h2 {
  align-items: center;
  color: var(--text);
  display: flex;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  justify-content: center;
  line-height: 1.35;
  margin: 0;
  max-height: var(--artwork-title-height);
  min-height: var(--artwork-title-height);
  overflow: hidden;
  padding: 14px 0 0;
  text-align: center;
}

.artwork-title-link {
  display: -webkit-box;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.artwork-viewing-room {
  display: grid;
  gap: clamp(42px, 6vw, 86px);
  grid-template-columns: minmax(460px, 1fr) minmax(300px, 390px);
  max-width: 1320px;
}

.artwork-detail-image {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.artwork-detail-image img {
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(32, 33, 31, 0.08);
  max-height: calc(100vh - 230px);
  object-fit: contain;
  object-position: center;
  padding: clamp(18px, 2.6vw, 42px);
  width: auto;
}

.artwork-detail-copy {
  align-self: center;
  max-width: 420px;
}

.artwork-meta {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 8px 18px;
  grid-template-columns: 90px 1fr;
  margin: 0 0 28px;
  padding: 22px 0;
}

.artwork-meta dt {
  color: var(--text);
  font-weight: 700;
}

.artwork-meta dd {
  margin: 0;
}

.artwork-detail-copy .entry-content {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.66;
  margin-bottom: 28px;
}

.artwork-nav {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  margin-top: 34px;
  padding-top: 22px;
}

.artwork-nav-link {
  color: var(--text);
  display: grid;
  gap: 5px;
  line-height: 1.25;
  text-decoration: none;
}

.artwork-nav-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.artwork-nav-link.next {
  text-align: right;
}

.content-page {
  max-width: 900px;
}

.entry-content {
  font-size: 18px;
  line-height: 1.72;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
  font-family: var(--display);
  line-height: 1.2;
  margin: 1.25em 0 0.45em;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin: 0 0 1em;
}

.artist-portrait {
  float: left;
  margin: 0 28px 18px 0;
  max-width: 240px;
}

.artist-portrait img {
  height: auto;
  width: 240px;
}

.artist-portrait figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}

.exhibition-item h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 30px 0 8px;
}

.exhibition-location {
  color: var(--muted);
  margin: 0 0 10px;
}

.exhibition-item hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
  width: 33%;
}

.button {
  align-items: center;
  appearance: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(124, 34, 48, 0.18);
  color: #ffffff;
}

.modal-backdrop {
  align-items: center;
  background: rgba(0, 0, 0, 0.44);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(30, 32, 29, 0.22);
  max-height: min(860px, 92vh);
  max-width: 620px;
  overflow: auto;
  padding: 26px;
  position: relative;
  width: 100%;
}

.modal-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  position: absolute;
  right: 18px;
  text-decoration: underline;
  top: 16px;
}

.inline-form-wrap {
  max-width: 620px;
}

.inquiry-form {
  display: grid;
  gap: 16px;
}

.inquiry-form label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 6px;
}

.inquiry-form input,
.inquiry-form textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hidden-field {
  left: -9999px;
  position: absolute;
}

.form-message {
  margin: 0;
}

.form-message.sent {
  color: #0f6f39;
}

.form-message.error {
  color: var(--accent);
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute !important;
  width: 1px;
}

.not-found {
  max-width: 720px;
}

@media (max-width: 1100px) {
  .site-main,
  .home-standard-main {
    margin-right: var(--outer-margin);
  }

  .side-menu {
    border-bottom: 1px solid var(--line);
    border-left: 0;
    border-top: 1px solid var(--line);
    margin: 0 var(--outer-margin) 28px;
    padding: 16px 0;
    position: static;
    width: auto;
  }

  .side-menu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 16px;
  }

  .side-menu-list li {
    margin: 0;
  }

  .side-menu-sublist {
    padding-left: 0;
  }
}

@media (max-width: 820px) {
  .artwork-viewing-room {
    grid-template-columns: 1fr;
  }

  .artwork-detail-copy {
    max-width: 720px;
  }

  .artwork-grid {
    --gallery-columns: 2;
    --gallery-gap-total: var(--gallery-column-gap);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: 24px;
  }

  .artwork-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .artwork-grid {
    --gallery-columns: 1;
    --gallery-gap-total: 0px;
    gap: 44px;
  }

  .artwork-meta,
  .artwork-nav {
    grid-template-columns: 1fr;
  }

  .artwork-nav-link.next {
    text-align: left;
  }

  .artist-portrait {
    float: none;
    margin: 0 0 22px;
  }

  .home-standard-image img,
  .artwork-detail-image img {
    height: auto;
    max-height: none;
    width: 100%;
  }

  .site-footer {
    margin-top: 0;
  }
}
