/* =====================================================================
   Dar al Ofoq · Proposal 6 · layout & behaviour layer for Elementor V4 atomic widgets
   Per-element skins live in the p6-* global classes (editable in Elementor).
   This file holds what classes cannot express: pseudo-elements, JS states,
   the prototype's exact breakpoints, door mechanics and decorative artwork.
   Every rule is scoped by body.p6 (added only on the Proposal 6 pages).
   ===================================================================== */

/* ---------------------------- Tokens ---------------------------- */
body.p6 {
  --ink: #241F1A; --muted: #5B5147; --paper: #F4EDDF; --paper-2: #FAF6EE; --sand: #ECE1CC; --pale: #E4DCCB;
  --green: #15453B; --green-deep: #0E332B; --gold: #C68A2E; --gold-l: #E7BC63; --terra: #A2472A;
  --line: rgba(36, 31, 26, .14); --line-light: rgba(244, 237, 223, .18); --gold-line: rgba(231, 188, 99, .22);
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --arabic: "Reem Kufi", "Noto Kufi Arabic", serif;
  --gutter: var(--p6-gutter, clamp(16px, 5vw, 72px));
  --sec-y: var(--p6-sec-y, clamp(72px, 9vw, 128px));
  --hdr: 72px;
  --arch: 50% 50% 8px 8px / 34% 34% 8px 8px;
  --arch-soft: 50% 50% 6px 6px / 22% 22% 6px 6px;
  --ease: cubic-bezier(.16, .8, .3, 1);
  --dots-green: radial-gradient(circle at center, rgba(21, 69, 59, .07) 0 1.5px, transparent 2px);
  --dots-gold: radial-gradient(circle at center, rgba(231, 188, 99, .10) 0 2px, transparent 2px);
  --i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --i-prev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4 7 12l8 8'/%3E%3C/svg%3E");
  --i-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4l8 8-8 8'/%3E%3C/svg%3E");
  --i-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E");
  --i-fwd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --i-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
  --i-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  --arc-terra: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 22'%3E%3Cpath d='M4 20 A18 18 0 0 1 40 20' fill='none' stroke='%23A2472A' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --arc-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 22'%3E%3Cpath d='M4 20 A18 18 0 0 1 40 20' fill='none' stroke='%23E7BC63' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");

  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--paper);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
html:has(body.p6) { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (max-width: 860px) { html:has(body.p6) { scroll-padding-top: 64px; } }
body.p6 *, body.p6 *::before, body.p6 *::after { box-sizing: border-box; }
body.p6 ::selection { background: var(--green); color: var(--paper); }
body.p6 :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
body.p6 a { text-decoration: none; }
body.p6 img { max-width: 100%; }
body.p6 :is(h1, h2, h3) { text-wrap: balance; }
body.p6 :is(.p6-room-row, .p6-copy-btn, .p6-door2__toggle, .p6-door3__toggle) { white-space: normal; }
body.p6 [lang="ar"] { font-family: var(--arabic); font-weight: 500; }
body.p6 .elementor-442, body.p6 [data-elementor-type="wp-page"] { overflow-x: clip; }
body.p6 .p6-page { padding: 0; }
body.p6 .p6-main { padding: 0; }
/* Elementor text widgets default to a pointer cursor */
body.p6 :is(.e-paragraph-base, .e-heading-base):not(a):not(:has(a)) { cursor: auto; }
/* Atomic containers ship a 10px padding: the design never uses it */
body.p6 .p6-page .e-div-block-base:not([class*="p6-"]) { padding: 0; }

/* shared mask-icon helper */
body.p6 :is(.p6-btn--arrow, .p6-textlink--arrow)::after,
body.p6 :is(.p6-icon-btn, .p6-menu-btn, .p6-door1__hint, .p6-sign__arrow, .p6-rcard2__body, .p6-rcard__more)::after,
body.p6 .p6-tick::before, body.p6 .p6-pager__link--prev::before, body.p6 .p6-pager__link--next::after {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icon, var(--i-arrow)) center / contain no-repeat; mask: var(--icon, var(--i-arrow)) center / contain no-repeat;
  transition: transform .2s;
}
body.p6 :is(.p6-btn--arrow, .p6-textlink--arrow):hover::after { transform: translateX(3px); }

/* ---------------------------- Shared type ---------------------------- */
body.p6 .p6-eyebrow::before { content: ""; width: 22px; height: 11px; flex: none; background: no-repeat center / contain var(--arc-terra); }
body.p6 .p6-eyebrow--light::before { background-image: var(--arc-gold); }
body.p6 :is(.p6-display, .p6-title, .p6-terrace__title, .p6-hero2__title, .p6-phero__title, .p6-summary__title) em { font-style: italic; color: var(--terra); }
body.p6 :is(.p6-display--light, .p6-hero1__title, .p6-hband__in .p6-display, .p6-included__col--extras .p6-title) em { color: var(--gold-l); }
body.p6 .p6-lede.p6-muted { color: var(--muted); }

/* ---------------------------- Buttons ---------------------------- */
body.p6 .p6-btn { text-decoration: none; }
body.p6 .p6-btn--gold:hover { transform: translateY(-2px); }
body.p6 .p6-btn-row--center { justify-content: center; }
body.p6 .p6-icon-btn { --icon: var(--i-next); }
body.p6 .p6-icon-btn::after { width: 18px; height: 18px; }
body.p6 .p6-icon-btn--sm::after { width: 15px; height: 15px; }
body.p6 .p6-icon-btn--prev { --icon: var(--i-prev); }
body.p6 .p6-icon-btn--back { --icon: var(--i-back); }
body.p6 .p6-icon-btn--fwd { --icon: var(--i-fwd); }
body.p6 .p6-icon-btn:disabled { opacity: .35; cursor: default; background: transparent; border-color: rgba(21, 69, 59, .35); }
body.p6 .p6-textlink:hover { color: var(--green); }
body.p6 .p6-textlink--light:hover { color: var(--gold-l); }
body.p6 .p6-notice strong { font-weight: 700; }

/* badge + arch shapes (elliptical radii are not native controls) */
body.p6 .p6-badge { border-radius: 50% 50% 2px 2px / 17px 17px 2px 2px; font-variant-numeric: lining-nums; }
body.p6 .p6-badge--xl { border-radius: 50% 50% 2px 2px / 26px 26px 2px 2px; }
body.p6 .p6-arch { border-radius: var(--arch); }
body.p6 .p6-arch::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(244, 237, 223, .55); border-radius: 50% 50% 4px 4px / 32% 32% 4px 4px; pointer-events: none; z-index: 2; }
body.p6 .p6-arch-img { border-radius: var(--arch); }
body.p6 .p6-door-plaque { translate: -50% 0; }

/* cedar door leaves, shared by Door 1 and Door 2 */
body.p6 .p6-leaf {
  background-image: radial-gradient(circle, var(--gold) 0 2.5px, transparent 3px);
  background-size: 30px 52px; background-repeat: repeat-y; backface-visibility: hidden;
}
body.p6 .p6-leaf--l { left: 0; transform-origin: 0 50%; background-position: 6px 26px; }
body.p6 .p6-leaf--r { right: 0; transform-origin: 100% 50%; background-position: right 6px top 26px; }
body.p6 .p6-leaf--l::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 1px; background: rgba(0, 0, 0, .45); }
body.p6 .p6-leaf__panel--top { top: 9%; bottom: 52%; border-radius: 50% 50% 0 0 / 22% 22% 0 0; }
body.p6 .p6-leaf__panel--bot { top: 56%; bottom: 9%; }
body.p6 .p6-leaf--l .p6-leaf__ring { right: 6%; }
body.p6 .p6-leaf--r .p6-leaf__ring { left: 6%; }
@media (max-width: 640px) { body.p6 .p6-leaf__panel { left: 12%; right: 12%; } }

/* =====================================================================
   HEADER, MENU OVERLAY (component "P6 Header")
   ===================================================================== */
body.p6 .p6-skip:focus { left: 12px; top: 12px; }
body.p6 .p6-header { -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); }
body.p6 .p6-header.is-scrolled { box-shadow: 0 8px 24px rgba(14, 51, 43, .08); }
body.admin-bar.p6 .p6-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar.p6 .p6-header { top: 46px; } }
body.p6 .p6-brand__mark { display: block; }
body.p6 .p6-nav__link::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 18px; height: 9px; transform: translateX(-50%) scale(.4);
  border: 2px solid var(--gold); border-bottom: 0; border-radius: 18px 18px 0 0; opacity: 0; transition: opacity .2s, transform .2s;
}
body.p6 .p6-nav__link:hover::after, body.p6 .p6-nav__link[aria-current="page"]::after { opacity: 1; transform: translateX(-50%) translateY(10px) scale(1); }
body.p6 .p6-nav__link:hover { color: var(--green-deep); }
body.p6 .p6-nav__link[aria-current="page"] { color: var(--terra); }
body.p6 .p6-nav .p6-btn[aria-current="page"] { background: var(--green-deep); outline: 1px solid var(--gold); outline-offset: 3px; }
body.p6 .p6-menu-btn { --icon: var(--i-menu); }
body.p6 .p6-menu-btn::after { width: 18px; height: 18px; }
body.p6 .p6-menu { background-image: var(--dots-gold); background-size: 34px 34px; transform: translateY(-8px); transition: opacity .3s, transform .3s, visibility 0s linear .3s; }
body.p6 .p6-menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .3s; }
body.admin-bar.p6 .p6-menu { top: 32px; }
body.p6 .p6-menu__close { --icon: var(--i-close); }
body.p6 .p6-menu__link span { font-family: var(--arabic); font-size: 18px; color: var(--gold-l); }
body.p6 .p6-menu__link[aria-current="page"] { color: var(--gold-l); }
@media (max-width: 860px) {
  body.p6 { --hdr: 64px; }
  body.p6 .p6-nav { display: none; }
  body.p6 .p6-menu-btn { display: inline-flex; }
  body.p6 .p6-header__in { min-height: 64px; }
  body.p6 .p6-brand__mark { width: 52px; }
  body.p6 .p6-brand__name { font-size: 21px; }
}
/* never show the overlay in the editor canvas */
body.elementor-editor-active .p6-menu { display: none; }

/* =====================================================================
   FOOTER + MOBILE DOCK (component "P6 Footer")
   ===================================================================== */
body.p6 .p6-footer__logo { display: block; }
body.p6 .p6-footer__link[href^="mailto"], body.p6 .p6-footer__link[href^="tel"] { overflow-wrap: anywhere; }
@media (max-width: 960px) { body.p6 .p6-footer__top { grid-template-columns: 1fr 1fr; } body.p6 .p6-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { body.p6 .p6-footer__top { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body.p6 { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.p6 .p6-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(14, 51, 43, .97); border-top: 1px solid rgba(231, 188, 99, .3);
  }
  body.p6 .p6-dock .p6-btn { min-height: 46px; padding: 0 12px; font-size: 12px; }
}
