/*
Theme Name: MEDI Garage Doors
Description: U.S. trade site for MEDI garage doors and OEM / ODM inquiries.
Version: 3.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: medi-garage-doors
*/

:root {
  --ink: #1f2121;
  --deep: #222421;
  --muted: #525952;
  --paper: #faf9f6;
  --white: #fff;
  --line: #dddbd4;
  --accent: #a53b19;
  --orange: #ee8558;
  --measure: 75rem;
  --space: clamp(3.2rem, 6.5vw, 6.5rem);
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.09; letter-spacing: -.043em; }
h1 { font-size: clamp(2.85rem, 6vw, 5.3rem); font-weight: 720; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
a { color: inherit; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #936329; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - 6rem), var(--measure)); margin-inline: auto; }
.section { padding-block: var(--space); }
.skip { position: absolute; top: .5rem; left: .5rem; padding: .6rem 1rem; background: white; z-index: 20; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.utility { background: #242622; color: #f8f6f0; font-size: .854rem; }
.utility__inner { display: flex; align-items: center; justify-content: space-between; min-height: 2.25rem; gap: 1rem; }
.utility a { color: #fbc0a1; text-decoration: none; }
.utility a:hover { text-decoration: underline; }
.site-header { position: relative; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 5.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; line-height: .93; font-weight: 800; font-size: 1.75rem; letter-spacing: -.065em; width: max-content; }
.brand small { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; display: block; padding-top: .35rem; white-space: nowrap; }
.brand-mark { display: block; width: 2.15rem; height: 2.15rem; flex: none; border: 3px solid currentColor; border-bottom: 0; border-radius: .12rem .12rem 0 0; color: var(--accent); position: relative; }
.brand-mark::after { content: ''; display: block; position: absolute; inset: .3rem .23rem .08rem; background: repeating-linear-gradient(to bottom, currentColor 0 .15rem, transparent .15rem .33rem); }
.custom-logo { max-height: 3rem; width: auto; }
.main-nav { display: flex; align-items: center; gap: clamp(.85rem, 2vw, 2rem); font-size: .96rem; font-weight: 650; }
.main-nav > a:not(.button), .products-menu summary { text-decoration: none; min-height: 44px; display: flex; align-items: center; white-space: nowrap; }
.main-nav a[aria-current='page'], .products-menu .current { color: var(--accent); }
.products-menu summary { list-style: none; cursor: pointer; gap: .5rem; }
.products-menu summary::-webkit-details-marker { display: none; }
.chevron { border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; width: .42rem; height: .42rem; transform: rotate(45deg) translateY(-2px); }
.products-menu[open] .chevron { transform: rotate(225deg); }
.mega { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 1.4rem 2.25rem; position: absolute; top: 100%; left: 50%; width: min(calc(100vw - 3rem), 53rem); transform: translateX(-50%); padding: 1.55rem 1.65rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--white); box-shadow: 0 15px 28px rgb(31 33 33 / .12); }
.mega strong { color: var(--accent); display: block; font-size: .82rem; margin-bottom: .5rem; }
.mega a { display: block; padding-block: .32rem; text-decoration: none; font-weight: 530; }
.mega a:hover { text-decoration: underline; }
.mega .mega-all { grid-column: 1 / -1; border-top: 1px solid var(--line); font-weight: 700; padding-top: .85rem; }
.main-nav > .mobile-guide:not(.button), .main-nav .mobile-quote, .menu-toggle { display: none; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .68rem 1.13rem; border: 1px solid transparent; background: var(--orange); color: #251913; text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.25; white-space: nowrap; }
.button:hover { background: #fbac85; color: #251913; }
.button--outline { border-color: #dedbd0; color: #fff; background: transparent; }
.button--outline:hover { background: #fff; color: var(--ink); }
.button--line { border-color: #a19f98; color: var(--ink); background: transparent; }
.button--line:hover { background: var(--ink); color: #fff; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.65rem; }
.eyebrow { color: var(--accent); font-size: .82rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 750; margin-bottom: .85rem; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.18rem); max-width: 40rem; line-height: 1.65; margin-top: 1rem; color: var(--muted); }
.lead > :not(:first-child) { margin-top: .7rem; }
.photo-block { overflow: hidden; background: #e4e0d8; }
.photo-block img { width: 100%; height: 100%; object-fit: cover; }

.hero { background: var(--deep); color: var(--white); }
.hero-grid { display: grid; grid-template-columns: .91fr 1.09fr; gap: clamp(1rem, 4vw, 4rem); min-height: clamp(30rem, 43.5vw, 41rem); }
.hero-copy { padding-block: clamp(2.6rem, 5vw, 4.6rem); align-self: center; }
.hero h1 { max-width: 13ch; font-size: clamp(2.85rem, 5.45vw, 4.9rem); }
.hero .eyebrow, .oem-feature .eyebrow { color: #f5a686; }
.hero .lead { color: #dfded6; max-width: 35rem; }
.hero-media { grid-area: 1 / 2; position: relative; min-width: 0; overflow: hidden; }
.hero-slide, .hero-media .photo-block, .hero-slide > img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; object-position: center; }
.hero-media .photo-block img { object-position: 56% center; }
.carousel-controls { display: flex; align-items: center; gap: .15rem; position: absolute; inset-inline-end: 1rem; inset-block-end: 1rem; background: rgb(25 27 25 / .92); color: #fff; border: 1px solid rgb(255 255 255 / .4); padding-inline: .25rem; }
.carousel-controls button { display: grid; place-items: center; min-width: 2.6rem; min-height: 2.65rem; color: inherit; background: transparent; border: 0; }
.carousel-controls button:hover { background: rgb(255 255 255 / .15); }
.carousel-controls button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.carousel-chevron { width: .56rem; height: .56rem; border-right: 2px solid; border-top: 2px solid; rotate: 45deg; }
.carousel-chevron--prev { rotate: 225deg; }
.carousel-dots { display: flex; }
.carousel-dots button { min-width: 1.72rem; }
.carousel-dots button::before { content: ''; width: .53rem; height: .53rem; border-radius: 50%; border: 1px solid #fff; }
.carousel-dots button[aria-pressed='true']::before { background: var(--orange); border-color: var(--orange); }
.carousel-controls .carousel-play { padding-inline: .6rem; min-width: 3.85rem; font-size: .88rem; border-inline-start: 1px solid rgb(255 255 255 / .4); }
.trade-strip { border-bottom: 1px solid var(--line); background: #f1eee7; }
.strip-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.strip-grid div { padding: 1.2rem 0; }
.strip-grid div + div { border-left: 1px solid #d5d0c4; padding-left: clamp(1rem, 3vw, 2.75rem); }
.strip-grid strong, .strip-grid span { display: block; }
.strip-grid strong { font-size: 1.02rem; font-weight: 720; }
.strip-grid span { color: var(--muted); font-size: .88rem; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.9rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3rem; }
.product-card { min-width: 0; border: 1px solid var(--line); background: white; }
.product-card > a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.product-card .photo-block, .project-card .photo-block { aspect-ratio: 1.58; }
.product-card .photo-block img { transition: transform .2s ease-out; }
.product-card a:hover img { transform: scale(1.035); }
.product-card__body { padding: 1.25rem 1.35rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: .6rem; }
.product-card__body p, .project-card p { color: var(--muted); }
.text-link { display: inline-block; color: var(--accent); font-size: .9rem; font-weight: 700; letter-spacing: .015em; text-decoration: underline; text-underline-offset: .25rem; }
.product-card__body .text-link { margin-top: auto; padding-top: .45rem; width: fit-content; }
.project-card h3 { margin-block: 1rem .45rem; }
.project-card .photo-block img { object-position: center 55%; }
.oem-feature { background: #333630; color: #fff; }
.oem-feature__grid { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(1.5rem, 5vw, 5rem); }
.oem-feature .photo-block { aspect-ratio: 1.6; }
.oem-feature h2 + p, .oem-feature .brief-list { margin-top: 1rem; color: #e5e3da; }
.oem-feature .button { margin-top: 1.5rem; }
.bottom-cta { background: #f0e7dc; padding-block: clamp(2.4rem, 5vw, 4.4rem); }
.bottom-cta__inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.bottom-cta h2 { font-size: clamp(1.85rem, 3.6vw, 2.9rem); }
.bottom-cta h2 + p { margin-top: .65rem; color: var(--muted); }

.page-intro { background: #ece9e0; padding-block: clamp(2.6rem, 6vw, 5.6rem); }
.page-intro h1 { max-width: 18ch; font-size: clamp(2.65rem, 5.4vw, 4.65rem); }
.catalog-section { padding-top: clamp(2.2rem, 4.3vw, 3.7rem); }
.filters { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filters button { background: transparent; border: 1px solid #a7a49c; padding: .45rem .85rem; min-height: 2.8rem; font-weight: 650; color: var(--ink); font-size: .9rem; }
.filters button:hover { border-color: var(--accent); }
.filters [aria-pressed='true'] { background: var(--deep); border-color: var(--deep); color: #fff; }
.product-section { padding-top: clamp(2rem, 4vw, 4rem); }
.breadcrumb { display: inline-block; color: var(--accent); font-size: .9rem; font-weight: 690; margin-bottom: 1.5rem; }
.product-detail { display: grid; align-items: start; grid-template-columns: 1.03fr .97fr; gap: clamp(1.5rem, 4vw, 4rem); }
.product-gallery { display: grid; gap: 1rem; }
.product-gallery .photo-block { aspect-ratio: 1.58; }
.product-gallery__additional { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.product-gallery__additional > :only-child { grid-column: 1 / -1; }
.product-copy .actions + p { margin-top: .85rem; }
.product-copy { padding-top: .3rem; }
.product-copy h1 { font-size: clamp(2.25rem, 4.45vw, 3.8rem); }
.copy > :where(h1, h2, p, ul, ol, .wp-block-image) + :where(p, h2, ul, ol, .wp-block-image) { margin-top: 1rem; }
.copy > h2 { font-size: clamp(1.35rem, 2.5vw, 1.9rem); margin-top: 1.65rem !important; }
.copy > p { color: var(--muted); }
.copy .eyebrow { color: var(--accent); }
.standard-page .copy { max-width: 50rem; }
.standard-page .copy + .copy { margin-top: 2rem; }
.two-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.info-panel { background: #fff; border: 1px solid var(--line); padding: clamp(1.4rem, 4vw, 2.75rem); }
.info-panel h2 { font-size: clamp(1.7rem, 3vw, 2.55rem); }
.info-panel h2 + p { color: var(--muted); margin-top: .8rem; }
.brief-list { padding-left: 1.25rem; }
.brief-list li + li { margin-top: .4rem; }
.feature-grid { gap: 1.5rem; }
.feature-card { background: white; border: 1px solid var(--line); }
.feature-card .photo-block { aspect-ratio: 1.65; }
.feature-card > div { padding: 1.2rem 1.5rem 1.45rem; }
.feature-card h2, .feature-card h3 { font-size: clamp(1.28rem, 2vw, 1.65rem); }
.feature-card p, .factory-hero p, .home-factory-preview p { margin-top: .55rem; color: var(--muted); }
.factory-section { padding-top: clamp(1.8rem, 4vw, 3.6rem); }
.factory-hero { background: #f1eee7; margin-bottom: 1.5rem; }
.factory-hero .photo-block { aspect-ratio: 2; }
.factory-hero .photo-block img { object-position: 50% 57%; }
.factory-hero__copy { padding: 1.35rem 1.55rem 1.6rem; }
.factory-hero__copy h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); }
.parts-card .photo-block { background: #fff; }
.parts-card .photo-block img { object-fit: contain; }
.opener-filters { margin-top: 1.3rem; }
.parts-card .opener-voltage { color: var(--accent); margin: 0 0 .55rem; }
.hardware-section, .order-home { padding-top: 0; }
.order-home .section-heading { border-top: 1px solid var(--line); padding-top: 2.8rem; margin-bottom: 0; }
.home-factory-preview { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(1.4rem, 4vw, 4rem); align-items: center; }
.home-factory-preview .photo-block { aspect-ratio: 1.75; }
.home-factory-preview .text-link { margin-top: .85rem; }
.zoom-photo { min-width: 0; }
.zoom-photo .photo-block { display: block; cursor: zoom-in; }
.zoom-photo figcaption { padding-block: .48rem; color: var(--muted); font-size: .91rem; }
.zoom-photo--contain img { object-fit: contain; background: #fff; }
.editorial-gallery { align-items: start; }
.editorial-gallery .photo-block { aspect-ratio: 1.45; }
.oem-gallery-section { background: #ece9e0; }
.oem-brief h2 { margin-bottom: .8rem; }
.project-feature { display: grid; align-items: center; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(1.4rem, 4vw, 4rem); }
.project-feature + .editorial-gallery { margin-top: 2rem; }
.project-feature .photo-block { aspect-ratio: 1.52; }
.project-feature__copy h3 { font-size: clamp(1.65rem, 3vw, 2.6rem); }
.project-feature__copy p { color: var(--muted); margin-block: .7rem 1rem; }
.media-viewer { width: min(95vw, 80rem); max-height: 94vh; margin: auto; padding: .85rem; border: 0; color: white; background: var(--deep); }
.media-viewer::backdrop { background: rgb(18 18 17 / .84); }
.media-viewer__close { display: block; margin: 0 0 .6rem auto; min-height: 2.6rem; padding-inline: .9rem; background: white; color: var(--ink); border: 0; font-weight: 700; }
.media-viewer img { max-height: 75vh; width: 100%; object-fit: contain; }
.media-viewer figcaption { text-align: center; padding: .6rem; }
.order-section > h2 { margin-bottom: 1.6rem; }
.order-steps { padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; list-style: none; }
.order-steps > li { padding: clamp(1.15rem, 2.4vw, 1.9rem); border: 1px solid var(--line); border-top: 3px solid var(--accent); background: #fff; }
.order-number { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; background: var(--deep); color: #fff; margin-bottom: 1rem; font-weight: 750; }
.order-steps ul { margin: .9rem 0 0; padding-left: 1.12rem; color: var(--muted); }
.order-steps ul li + li { margin-top: .42rem; }
.measurement-section { background: #ece9e0; }
.measurement-grid { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(0, .83fr); align-items: start; gap: clamp(1.25rem, 4vw, 3.5rem); margin-top: 1.6rem; }
.measurement-grid img { width: 100%; }
.measurement-list { margin: 0; padding: 0; list-style: none; counter-reset: measure; }
.measurement-list li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); align-items: start; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid #c4c0b4; counter-increment: measure; }
.measurement-list li::before { content: counter(measure); display: grid; place-items: center; font-weight: 750; color: var(--accent); border: 1px solid currentColor; border-radius: 50%; width: 1.8rem; height: 1.8rem; }
.measurement-list p { color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: .6fr 1.4fr; gap: clamp(1.5rem, 5vw, 5rem); }
.contact-side h2, .quote-form h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
.contact-side p { margin-top: 1rem; color: var(--muted); }
.contact-side a, .quote-form a { color: var(--accent); overflow-wrap: anywhere; }
.quote-form { border: 1px solid var(--line); padding: clamp(1.2rem, 4.1vw, 2.7rem); background: #fff; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.1rem; margin-block: 1.25rem; }
.fields label { font-weight: 620; min-width: 0; }
.fields input, .fields select, .fields textarea { display: block; width: 100%; border: 1px solid #a7a49c; background: #fcfbf8; color: var(--ink); border-radius: 0; padding: .58rem .68rem; min-height: 2.85rem; margin-top: .3rem; font-weight: 400; }
.fields textarea { resize: vertical; }
.field-wide { grid-column: 1 / -1; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-hint { margin-top: .35rem; color: var(--muted); }
.consent { display: flex; align-items: flex-start; gap: .55rem; margin-bottom: 1.2rem; }
.consent input { margin: .3rem 0 0; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
.notice { padding: .7rem .85rem; background: #fbebdf; border-left: 4px solid var(--accent); margin-bottom: 1rem; }
.notice--received { background: #e4f0e8; border-left-color: #2c6b4b; }

.site-footer { padding: 3rem 0 1rem; background: #242622; color: #f8f6ee; }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 1.5rem 3rem; }
.brand--footer .brand-mark { color: var(--orange); }
.footer-grid p { margin-top: .9rem; max-width: 28ch; color: #d8d9cf; }
.footer-grid h2 { font-size: 1rem; letter-spacing: 0; margin-bottom: .65rem; }
.footer-grid a:not(.brand) { display: block; margin-block: .3rem; color: #d8d9cf; text-decoration: none; overflow-wrap: anywhere; }
.footer-grid a:hover, .footer-bottom a:hover { color: #f7a689; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid #55594f; margin-top: 2.2rem; padding-top: 1rem; color: #d8d9cf; font-size: .88rem; }
.footer-bottom small { font-size: inherit; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 3rem); }
  .header-inner { gap: 1rem; }
  .main-nav { gap: 1.05rem; }
  .hero-grid { gap: 1rem; }
  .card-grid { gap: .95rem; }
}

@media (max-width: 1110px) {
  .wrap { width: calc(100% - 2rem); }
  .utility__inner { min-height: 2.45rem; padding-block: .3rem; }
  .utility__inner > a { display: none; }
  .header-inner { min-height: 4.3rem; flex-wrap: wrap; padding-block: .6rem; }
  .header-quote { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); background: transparent; border: 1px solid var(--line); min-height: 2.65rem; padding: .35rem .68rem; font-weight: 650; }
  .menu-toggle span { width: .9rem; height: .62rem; border-block: 2px solid currentColor; }
  .main-nav { width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav.menu-ready:not(.menu-open) { display: none; }
  .main-nav > a:not(.button), .products-menu summary { padding: .4rem .2rem; border-top: 1px solid var(--line); }
  .main-nav .mobile-quote { display: inline-flex; margin-block: .5rem; align-self: flex-start; }
  .main-nav > .mobile-guide:not(.button) { display: flex; }
  .mega { width: 100%; position: static; transform: none; grid-template-columns: 1fr; box-shadow: none; gap: .75rem; padding: .8rem 1rem; }
  .mega a { padding-block: .4rem; }
  .hero-grid { display: block; min-height: auto; }
  .hero h1 { max-width: 13ch; }
  .hero-media { aspect-ratio: 1.5; }
  .strip-grid { padding-block: .5rem; }
  .strip-grid div { padding-block: .4rem; }
  .strip-grid div + div { padding-left: .55rem; }
  .strip-grid span { font-size: .78rem; }
  .strip-grid strong { font-size: .86rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oem-feature__grid, .product-detail, .contact-grid { grid-template-columns: 1fr; }
  .home-factory-preview { grid-template-columns: 1fr; }
  .product-detail .product-copy { grid-row: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .bottom-cta__inner { align-items: start; flex-direction: column; gap: 1rem; }
}

@media (max-width: 720px) {
  .order-steps, .measurement-grid, .project-feature { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .card-grid, .two-grid, .fields { grid-template-columns: 1fr; }
  .trade-strip .wrap { width: calc(100% - 1.5rem); }
  .product-card__body { padding-inline: 1rem; }
  .footer-grid { gap: 1.5rem 1rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
