/* ==========================================================================
   UCHÉ FRANKLYN INTERIOR DECOR — Gallery Showroom Stylesheet
   ========================================================================== */

/* --- Font Face (Self-Hosted Archivo) --- */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/archivo.woff2') format('woff2-variations'),
       url('/fonts/archivo.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Theme Variables --- */
:root {
  --font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg: #F5F4F2;
  --bg-card: #FFFFFF;
  --bg-banner: #EAE8E4;
  --text: #17191C;
  --text-muted: #595D62; /* 5.5:1 contrast against #F5F4F2 (WCAG AA compliant) */
  --stone-grey: #8C9096;
  --border: rgba(23, 25, 28, 0.14);
  --border-strong: rgba(23, 25, 28, 0.35);
  --accent: #6B2430; /* Deep wine (9.95:1 contrast on white) */
  --accent-hover: #501923;
  --accent-text: #F5F4F2;
  --focus-ring: #6B2430;
  --error: #96252F;
  --hero-gradient: linear-gradient(180deg, rgba(23, 25, 28, 0) 30%, rgba(23, 25, 28, 0.88) 100%);
  --bottom-bar-height: 64px;
  --header-height: 68px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg: #17191C;
  --bg-card: #1F2226;
  --bg-banner: #23272C;
  --text: #F5F4F2;
  --text-muted: #9EA3AA; /* 6.9:1 contrast against #17191C (WCAG AA compliant) */
  --stone-grey: #8C9096;
  --border: rgba(245, 244, 242, 0.15);
  --border-strong: rgba(245, 244, 242, 0.35);
  --accent: #E28494; /* Lightened deep wine (6.68:1 contrast on #17191C) */
  --accent-hover: #F09CA9;
  --accent-text: #17191C; /* Ink charcoal on lightened wine (6.68:1 contrast) */
  --focus-ring: #E28494;
  --error: #FF8F9B;
  --hero-gradient: linear-gradient(180deg, rgba(23, 25, 28, 0.1) 25%, rgba(23, 25, 28, 0.95) 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191C;
    --bg-card: #1F2226;
    --bg-banner: #23272C;
    --text: #F5F4F2;
    --text-muted: #9EA3AA;
    --stone-grey: #8C9096;
    --border: rgba(245, 244, 242, 0.15);
    --border-strong: rgba(245, 244, 242, 0.35);
    --accent: #E28494;
    --accent-hover: #F09CA9;
    --accent-text: #17191C;
    --focus-ring: #E28494;
    --error: #FF8F9B;
    --hero-gradient: linear-gradient(180deg, rgba(23, 25, 28, 0.1) 25%, rgba(23, 25, 28, 0.95) 100%);
  }
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(var(--bottom-bar-height) + 16px);
  }
}

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

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* --- Container & Dividers --- */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

@media (min-width: 768px) {
  .container {
    padding-left: 36px;
    padding-right: 36px;
  }
}

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--border);
  border: none;
}

/* --- Preview Banner --- */
.preview-banner {
  background-color: var(--bg-banner);
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding-left: 20px;
  padding-right: 20px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .header-inner {
    padding-left: 36px;
    padding-right: 36px;
  }
}

/* --- Wordmark --- */
.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}

.wm-name {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.wm-sub {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--stone-grey);
  margin-top: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  min-height: 48px;
  min-width: 44px;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  min-height: 44px;
}

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background-color: transparent;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.8);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #FFFFFF;
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline-dark:hover {
  background-color: var(--border);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0;
  background-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background-color: var(--border);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-sun {
  display: none;
}
.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  width: 100%;
  min-height: 82vh;
  min-height: 82svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: #17191C;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    min-height: 88vh;
  }
}

.hero-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* Ensures curtain heading at the top is never cut off */
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: var(--hero-gradient);
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 20px 48px 20px;
  color: #FFFFFF;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 60px 36px 64px 36px;
  }
}

.hero-title {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  margin-bottom: 12px;
  max-width: 900px;
}

@media (min-width: 480px) {
  .hero-title {
    font-size: 40px;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 58px;
    letter-spacing: 0.06em;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 68px;
  }
}

.hero-sub {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
  max-width: 650px;
}

@media (min-width: 768px) {
  .hero-sub {
    font-size: 19px;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
}

/* --- Section Headings --- */
.section {
  padding-top: 64px;
  padding-bottom: 64px;
}

@media (min-width: 768px) {
  .section {
    padding-top: 96px;
    padding-bottom: 96px;
  }
}

.section-header {
  margin-bottom: 48px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: var(--text);
}

@media (min-width: 768px) {
  .section-title {
    font-size: 44px;
  }
}

.section-desc {
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 10px;
  max-width: 600px;
}

/* --- Magazine Work Layout --- */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

@media (min-width: 768px) {
  .work-list {
    gap: 96px;
  }
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .work-item {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 48px;
    align-items: center;
  }

  .work-item-reverse {
    grid-template-columns: 5fr 7fr;
  }

  .work-item-reverse .work-photo-wrap {
    order: 2;
  }

  .work-item-reverse .work-info {
    order: 1;
  }
}

.work-photo-wrap {
  width: 100%;
  position: relative;
  background-color: var(--bg-card);
}

.work-photo-btn {
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
}

.work-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
  transition: opacity 0.2s ease;
}

.work-photo-btn:hover .work-img {
  opacity: 0.95;
}

.zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background-color: rgba(23, 25, 28, 0.8);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  pointer-events: none;
}

.work-info {
  display: flex;
  flex-direction: column;
}

.work-num {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.work-caption {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
}

@media (min-width: 768px) {
  .work-caption {
    font-size: 21px;
  }
}

/* --- Section: Choose Your Fabric --- */
.fabric-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 768px) {
  .fabric-grid {
    display: grid;
    grid-template-columns: 6fr 6fr;
    gap: 48px;
    align-items: center;
  }
}

.fabric-media {
  width: 100%;
  position: relative;
}

.fabric-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
}

.fabric-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fabric-lead {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
}

@media (min-width: 768px) {
  .fabric-lead {
    font-size: 24px;
  }
}

/* --- Section: How It Works --- */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.step-card {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

@media (min-width: 768px) {
  .step-number {
    font-size: 40px;
  }
}

.step-text {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
}

@media (min-width: 768px) {
  .step-text {
    font-size: 20px;
  }
}

/* --- Section: On Site --- */
.onsite-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.onsite-media {
  width: 100%;
}

.onsite-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
}

.onsite-caption {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* --- Section: Send Your Window (Form) --- */
.form-section-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.window-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  background-color: var(--bg-card);
  padding: 32px 24px;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .window-form {
    padding: 40px 36px;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-family);
  font-size: 16px;
  padding: 13px 16px;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0;
  line-height: 1.5;
  transition: border-color 0.15s ease;
  min-height: 48px;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.form-input.has-error,
.form-select.has-error {
  border-color: var(--error);
}

.field-error {
  font-size: 13px;
  color: var(--error);
  font-weight: 700;
  display: none;
}

.field-error.active {
  display: block;
}

.form-footnote {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Section: Visit --- */
.visit-wrap {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.visit-address {
  font-size: 30px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--text);
}

@media (min-width: 768px) {
  .visit-address {
    font-size: 42px;
  }
}

.visit-ask {
  font-size: 20px;
  color: var(--text-muted);
}

.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 64px;
  padding-bottom: 48px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (min-width: 768px) {
  .footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-phone {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .footer-phone {
    font-size: 36px;
  }
}

.footer-phone:hover {
  color: var(--accent);
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.footer-legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-legal {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Mobile Bottom Bar --- */
.mobile-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-bar-height);
    background-color: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 80;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .mobile-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    height: 100%;
    min-height: 48px;
    text-align: center;
    padding: 0 12px;
  }

  .mobile-bar-wa {
    background-color: var(--accent);
    color: var(--accent-text);
  }

  .mobile-bar-call {
    background-color: var(--bg);
    color: var(--text);
    border-left: 1px solid var(--border);
  }

  /* Hidden when keyboard or form field focused */
  body.keyboard-open .mobile-bar {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }
}

/* --- Lightbox Modal --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(23, 25, 28, 0.94);
}

.lightbox-dialog {
  position: relative;
  z-index: 1001;
  width: 100%;
  height: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 20px 30px 20px;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 1005;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 1005;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 640px) {
  .lightbox-nav {
    display: none; /* Mobile uses swipe gestures */
  }
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(100vh - 120px);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: 14px;
  font-size: 15px;
  color: #F5F4F2;
  text-align: center;
  max-width: 700px;
  font-weight: 400;
  line-height: 1.4;
}

/* --- 404 Page --- */
.notfound-section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.notfound-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.notfound-title {
  margin-bottom: 16px;
}

.notfound-desc {
  margin: 0 auto 32px auto;
}

/* --- Subtle Scroll Reveal Motion --- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
