@font-face {font-family:'Tarhim YekanBakh';src:url('../fonts/YekanBakh-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim YekanBakh';src:url('../fonts/YekanBakh-SemiBold.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim YekanBakh';src:url('../fonts/YekanBakh-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim YekanBakh';src:url('../fonts/YekanBakh-ExtraBold.woff2') format('woff2');font-weight:800;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim IRANSansX';src:url('../fonts/IRANSansX-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim IRANSansX';src:url('../fonts/IRANSansX-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face {font-family:'Tarhim IRANSansX';src:url('../fonts/IRANSansX-DemiBold.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap}

#root .memorial-post__panel.memorial-post__ceremony {display:flex;flex-direction:column;box-sizing:border-box;min-height:331px;padding:24px;background:#1d1d1d;border:0;border-radius:6px}
#root .memorial-post__ceremony #memorial-ceremony {display:flex;align-items:center;gap:16px;color:white;font:700 32px/48px 'Tarhim YekanBakh',sans-serif;margin:0 0 16px}
#root .memorial-post__ceremony .memorial-post__facts {color:#e2e2e2;margin:0 0 16px}
#root .memorial-post__ceremony .memorial-post__facts dt {font:400 14px/21px 'Tarhim IRANSansX',Tahoma,sans-serif}
#root .memorial-post__ceremony .memorial-post__facts dd {font:400 16px/24px 'Tarhim IRANSansX',Tahoma,sans-serif}
#root .memorial-post__ceremony p.ceremony-ended {display:grid;place-items:center;align-self:stretch;flex:0 0 48px;min-height:48px;margin:auto 0 0;border:0;border-radius:4px;background:#343434;color:#b1b1b1;font:400 14px/24px 'Tarhim IRANSansX',Tahoma,sans-serif;cursor:default;box-shadow:none;transform:none}

#root #plans .plan-card__features li {font:400 16px/2 "Tarhim IRANSansX",sans-serif;height:auto;white-space:normal}
/* Shared text roles take priority over the independently built page bundles. */
@layer site-typography {
  :root {
    --reading-font: 'Tarhim IRANSansX', Tahoma, sans-serif;
    --heading-font: 'Tarhim YekanBakh', Tahoma, sans-serif;
    --page-size: 40px;
    --section-size: 32px;
  }

  @media (max-width: 767px) {
    :root {
      --page-size: 28px;
      --section-size: 24px;
    }
  }

  body {
    font-family: var(--reading-font) !important;
    font-size: 16px;
    line-height: 2;
  }

  /* Page bundles assign fonts directly to nested labels, numbers and links. */
  :where(body *:not(svg, svg *, code, pre, kbd)) {
    font-family: inherit !important;
  }

  :where(h1, h2, h3, h4, h5, h6, [role="heading"]) {
    font-family: var(--heading-font) !important;
  }

  :where(h1) {
    font-size: var(--page-size) !important;
    line-height: 1.5 !important;
  }

  :where(h2:not(footer *, nav *)) {
    font-size: var(--section-size) !important;
    line-height: 1.5 !important;
  }

  :where(h3:not(footer *), h4:not(footer *), .live-card h2,
         .blog-featured__card h2, .contact-card h2, .plan-card h2,
         .memorial-card h2, .archive-card h2, .service-card h2, .news-card h2) {
    font-size: 20px !important;
    line-height: 30px !important;
  }

  :where(p:not([class$="__eyebrow"], .ceremony-ended, .memorial-post__years,
               .plan-card__price, .site-header *, .site-footer__copyright),
         .guide-body li, .plan-card__features li, .memorial-record__description,
         .contact-faq__answer-inner, [contenteditable="true"], #studio-post) {
    font-family: var(--reading-font) !important;
    font-size: 16px !important;
    line-height: 32px !important;
  }

  :where(button, input, select, textarea, label, legend, option, .button,
         .plan-card__request, .live-card__actions a, .contact-hero__actions a,
         .memorial-card__view, .archive-card__view, .memorial-post__button,
         .blog-read__button, .guide-contents__request, .guide-contents__support,
         .request-support, .service-card__more, .news-read, [role="button"]) {
    font-family: var(--reading-font) !important;
  }

  :where(button:not(.site-header__brand, .site-header__toggle, .icon-button,
                    .memorial-index-search *, .mobile-carousel-controls *),
         input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]),
         select, textarea, option, label, legend, .button, .plan-card__request,
         .live-card__actions a, .contact-hero__actions a, .memorial-card__view,
         .archive-card__view, .memorial-post__button, .blog-read__button,
         .guide-contents__request, .guide-contents__support, .request-support,
         .service-card__more, .news-read) {
    font-size: 16px !important;
    line-height: 24px !important;
  }

  :where(:is(h1,h2,h3,h4,h5,h6,p,button,label,legend,.plan-card__features li,
             .live-card__actions a,.memorial-card__view,.archive-card__view,
             .memorial-post__button,.plan-card__request,.blog-read__button)
         :is(span,strong,b,em,bdi,a):not(.site-header *, .site-footer *,
                                        .plan-card__price *, [aria-hidden="true"])) {
    font-size: inherit !important;
    line-height: inherit !important;
  }

  :where(input, textarea)::placeholder {
    font-family: var(--reading-font) !important;
    font-size: 16px !important;
    line-height: 24px !important;
  }
}

/* Let the tallest plan determine the row; each feature remains in normal flow. */
#root #plans .memorial-plans__grid {
  grid-template-rows: none;
  grid-auto-rows: auto;
  align-items: stretch;
}
#root #plans .plan-card {
  block-size: auto;
  max-block-size: none;
  min-inline-size: 0;
  overflow: visible;
}
#root #plans .plan-card :is(.plan-card__features, .plan-card__description) {
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  flex-shrink: 0;
}
#root #plans .plan-card__features li span {
  min-inline-size: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#root #plans .plan-card__price {
  flex-wrap: wrap;
  block-size: auto;
}

/* Both navigation columns reserve the full width of their headings. */
#root footer.site-footer .site-footer__columns {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 235px);
}
#root footer.site-footer nav.site-footer__column > h2 {
  inline-size: max-content;
  max-inline-size: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 24px;
  line-height: 37px;
}
@media (max-width: 767px) {
  #root footer.site-footer .site-footer__columns {
    grid-template-columns: repeat(2, minmax(max-content, 1fr));
    column-gap: 12px;
  }
  #root footer.site-footer nav.site-footer__column > h2 {
    font-size: 20px;
    line-height: 30px;
  }
  #root footer.site-footer .site-footer__contact {grid-column: 1 / -1;}
}
@media (max-width: 359px) {
  #root footer.site-footer .site-footer__columns {grid-template-columns: minmax(0, 1fr);}
}

/* The status occupies the same full-width action row as registration. */
@layer site-typography {
  .memorial-post__ceremony button.ceremony-ended:disabled {
    font-family: var(--reading-font) !important;
    font-size: 14px !important;
    line-height: 24px !important;
  }
}
#root .memorial-post__panel.memorial-post__ceremony > button.ceremony-ended:disabled {
  appearance: none;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 48px;
  flex: 0 0 48px;
  margin: auto 0 0;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: #343434;
  color: #b1b1b1;
  -webkit-text-fill-color: currentColor;
  opacity: 1;
  font-weight: 400;
  box-shadow: none;
  cursor: default;
}

#root .memorial-index-search button {display: grid; place-items: center; padding: 0;}
#root .memorial-index-search button::after {content: none;}
#root .memorial-index-search button img {display: block; width: 24px; height: 24px;}

/* Let long footer labels wrap within independent columns on form pages. */
#root :is(.request-page,.contact-page) > footer.site-footer {
  box-sizing: border-box;
  padding-inline: max(clamp(16px,4vw,50px), calc((100% - 1340px) / 2));
}
#root :is(.request-page,.contact-page) > footer .site-footer__brand {
  height: auto;
  min-height: 48px;
}
#root :is(.request-page,.contact-page) > footer .site-footer__columns {
  display: grid;
  grid-template-columns: max-content max-content minmax(0,235px);
  gap: 24px clamp(20px,7vw,120px);
}
#root :is(.request-page,.contact-page) > footer nav.site-footer__column,
#root :is(.request-page,.contact-page) > footer .site-footer__brand-copy {
  min-inline-size: 0;
}
#root :is(.request-page,.contact-page) > footer li {height: auto;}
#root :is(.request-page,.contact-page) > footer .site-footer__contact p {
  white-space: normal;
  overflow-wrap: anywhere;
}
#root :is(.request-page,.contact-page) > footer .site-footer__logo img {
  height: 131.8%;
}
@media (max-width: 767px) {
  #root :is(.request-page,.contact-page) > footer .site-footer__columns {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 24px 16px;
  }
  #root :is(.request-page,.contact-page) > footer nav.site-footer__column > h2 {
    inline-size: auto;
    white-space: normal;
  }
}
@media (max-width: 374px) {
  #root :is(.request-page,.contact-page) > footer .site-footer__columns {grid-template-columns: 1fr;}
}
#root .memorial-index-search button {
  inline-size: 48px;
  block-size: 48px;
  flex: 0 0 48px;
}
#root .memorial-index-search button::before {content: none;}

#root .memorial-post__location {
  box-sizing:border-box; min-height:317px; padding:24px;
  background:#1d1d1d; border:0; border-radius:6px;
}
#root .memorial-post__location h2 {display:flex; align-items:center; gap:16px; margin:0 0 16px}
#root .memorial-post__location h2 img {width:32px; height:3px}
#root .memorial-post__location .memorial-post__address {margin:0 0 20px; overflow-wrap:anywhere}
#root .memorial-post__map-buttons {gap:8px}
#root .memorial-post__map-buttons .memorial-post__button {
  height:48px; min-height:48px; box-sizing:border-box; text-decoration:none;
}
#root .landing-preview a.archive-card {display:block; color:inherit; text-decoration:none}
#root .landing-preview a.archive-card:focus-visible {outline:2px solid #d1c56c; outline-offset:3px}
@media(hover:hover) and (pointer:fine) {
  #root .landing-preview a.archive-card:hover {border-color:#d1c56c}
  #root .memorial-post__button:not(:disabled):hover {
    background:#d1c56c; color:#181818;
  }
  #root .memorial-post__button--filled:not(:disabled):hover {background:#e6db8a;color:#181818}
  #root .memorial-post__button:not(:disabled):hover img {filter:brightness(0)}
}

#root .memorial-post__location .memorial-post__map-notice {margin:0; color:#e2e2e2;}
#root .memorial-post__map-buttons .memorial-post__button {
  transition:background-color .22s ease,color .22s ease,transform .22s ease;
}
#root .memorial-post__map-buttons .memorial-post__button:is(:focus-visible,:active) {
  background:#d1c56c; color:#000;
}
#root .memorial-post__map-buttons .memorial-post__button--filled:is(:focus-visible,:active) {
  background:transparent; color:#e2e2e2;
}
#root .memorial-post__map-buttons .memorial-post__button:is(:focus-visible,:active) img {filter:brightness(0)}
#root .memorial-post__map-buttons .memorial-post__button--filled:is(:focus-visible,:active) img {filter:brightness(0) invert(.89)}
@media (hover:hover) and (pointer:fine) {
  #root .memorial-post__map-buttons .memorial-post__button:hover {
    background:#d1c56c; color:#000; transform:translateY(-2px);
  }
  #root .memorial-post__map-buttons .memorial-post__button--filled:hover {
    background:transparent; color:#e2e2e2;
  }
  #root .memorial-post__map-buttons .memorial-post__button--filled:hover img {filter:brightness(0) invert(.89)}
}
@media (prefers-reduced-motion:reduce) {
  #root .memorial-post__map-buttons .memorial-post__button {transition:none}
  #root .memorial-post__map-buttons .memorial-post__button:hover {transform:none}
}

#root .ended-gallery {background:#1e1e1e;padding:clamp(16px,2vw,24px);min-width:0}
#root .ended-gallery__tabs {display:flex;gap:16px;border-bottom:1px solid #343434;margin:16px 0 20px}
#root .ended-gallery__tabs button {background:transparent;font:inherit;color:#aaa;border:0;border-bottom:2px solid transparent;padding:8px 0 12px;cursor:pointer}
#root .ended-gallery__tabs button[aria-selected=true] {color:#d1c56c;border-color:#d1c56c;font-weight:700}
#root .ended-gallery__grid:not([hidden]) {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1.3vw,16px)}
#root .ended-gallery__grid[hidden] {display:none}
#root .ended-gallery__grid :is(img,video) {box-sizing:border-box;width:100%;height:100%;min-width:0;aspect-ratio:1;object-fit:cover;border:1px solid #d1c56c;border-radius:8px}
#root .ended-gallery__grid :is(img,video):first-child {grid-column:span 2;aspect-ratio:2.06}
#root .ended-gallery__grid video {object-fit:contain;background:#111}
#root a.archive-more {
  box-sizing:border-box;display:flex;align-items:center;justify-content:center;
  inline-size:137px;max-inline-size:100%;min-block-size:48px;margin:32px auto 0;
  padding:0 12px;border:1px solid #202020;border-radius:4px;background:#1d1d1d;color:white;
  font:600 16px/24px "Yekan Bakh",IRANSansX,sans-serif;text-decoration:none;
  transition:background-color .2s,color .2s,border-color .2s;
}
#root a.archive-more:is(:focus-visible,:active) {color:#151515;background:#d1c56c;border-color:#d1c56c}
@media(hover:hover){#root a.archive-more:hover {color:#151515;background:#d1c56c;border-color:#d1c56c}}
#root a.archive-more:focus-visible,#root .ended-gallery button:focus-visible {outline:2px solid #d1c56c;outline-offset:4px}
@media(prefers-reduced-motion:reduce){#root a.archive-more {transition:none}}

#root .memorial-card:is([data-profile-id="memorial-mother"],[data-profile-id="memorial-father"]) {
  display:grid; grid-template-columns:minmax(0,54%) 1fr; grid-template-rows:1fr auto minmax(48px,auto) auto;
  align-content:end; gap:8px 0; padding:16px; box-sizing:border-box; direction:rtl;
}
#root .memorial-card:is([data-profile-id="memorial-mother"],[data-profile-id="memorial-father"]) > :is(.memorial-card__copy,.memorial-card__dates,.memorial-card__view) {
  position:static;grid-column:1;align-self:end;justify-self:start;max-width:100%;width:auto;margin:0;
}
#root [data-profile-id] .memorial-card__copy {grid-row:2}
#root [data-profile-id] .memorial-card__dates {grid-row:3}
#root [data-profile-id] .memorial-card__view {grid-row:4}
#root .archive-card__media:has(.archive-date) {aspect-ratio:320/220;height:auto}
#root .archive-date {position:absolute;bottom:7%;width:31%;display:grid;justify-items:center;align-content:center;height:25%;z-index:1;color:#f9edd5;font:600 clamp(9px,3.5cqw,13px)/1.2 IRANSansXFaNum,sans-serif;pointer-events:none}
#root .archive-date b {font-size:clamp(15px,6cqw,24px)}
#root .archive-date--birth {right:2.6%} #root .archive-date--death {left:2.6%}

/* Keep the media panel one photo-row high at every gallery width. */
#root .ended-gallery, #root details:has(> .ended-gallery__grid) {container-type:inline-size}
#root .ended-gallery__grid:not([hidden]) {
  --media-gap:clamp(8px,1.3vw,16px);
  --row-height:calc((100cqi - 2 * var(--media-gap)) / 3);
  block-size:var(--row-height);
  grid-auto-rows:var(--row-height);
  overflow-y:auto;
  overflow-x:hidden;
  align-content:start;
}
#root .ended-gallery__grid :is(img,video):nth-child(odd) {grid-column:span 2}

#root .ended-gallery__grid {direction:rtl;scrollbar-color:#bdaf61 #292821;scrollbar-width:thin}
#root .ended-gallery__grid::-webkit-scrollbar {width:7px}
#root .ended-gallery__grid::-webkit-scrollbar-track {background:#292821;border-radius:8px}
#root .ended-gallery__grid::-webkit-scrollbar-thumb {background:#bdaf61;border:1px solid #292821;border-radius:8px}
#root .ended-gallery__grid::-webkit-scrollbar-thumb:hover {background:#dfd07a}

#root .request-fields .request-ceremony-choices {display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,2vw,20px)}
#root .request-ceremony-choices .request-select-field,#root .request-ceremony-choices .request-select__value {min-width:0}
#root .request-ceremony-choices .request-select__value {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:767px) {
  #root #archive #archive-carousel {display:flex;flex-flow:row nowrap;direction:rtl;width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow-x:auto;scroll-snap-type:x mandatory;padding-inline:0;gap:16px}
  #root #archive #archive-carousel > .archive-card {flex:0 0 100%;width:100%;min-width:0;max-width:100%;box-sizing:border-box;scroll-snap-align:start;scroll-snap-stop:always}
  #root #plans .memorial-plans__grid {align-items:flex-start}
  #root #plans .plan-card {min-height:0;height:auto;padding:24px 16px 14px}
  #root #plans .plan-card__description {min-height:0;margin-block-start:4px}
  #root #plans .plan-card__divider {margin-block-start:9px}
  #root #plans .plan-card__features {margin-block-start:8px;gap:3px}
  #root #plans .plan-card__features li {line-height:1.55}
  #root #plans .plan-card__price {padding-block-start:0;margin-block-start:10px}
  #root #plans .plan-card__request {height:48px;margin-block-start:8px}
  #root .request-ceremony-choices .request-select {width:100%;padding-inline:8px;gap:4px}
}

@media (max-width:767px) {
  #root .memorial-listing__grid article.memorial-card[data-profile-id] {
    display:grid;
    grid-template-columns:max-content minmax(0,1fr);
    grid-template-rows:1fr auto auto auto;
    align-content:stretch;
    direction:rtl;
    row-gap:8px;
    padding:12px;
    box-sizing:border-box;
  }
  #root .memorial-listing__grid article[data-profile-id] > :is(.memorial-card__copy,.memorial-card__dates,.memorial-card__view) {
    position:static;
    grid-column:1;
    justify-self:start;
    align-self:end;
    width:auto;
    max-width:none;
    margin:0;
    white-space:nowrap;
  }
  #root .memorial-listing__grid .memorial-card__copy {display:grid;gap:3px;grid-row:2}
  #root .memorial-listing__grid .memorial-card__dates {display:grid;gap:4px;grid-row:3}
  #root .memorial-listing__grid .memorial-card__dates p {margin:0;gap:5px;min-height:0}
  #root .memorial-listing__grid .memorial-card__view {grid-row:4;height:44px}
}
@layer site-typography {
  @media (max-width:767px) {
    #root .memorial-listing__grid .memorial-card__copy h3 {font-size:clamp(17px,4.8vw,20px)!important;line-height:1.5!important}
    #root .memorial-listing__grid .memorial-card__copy p,
    #root .memorial-listing__grid .memorial-card__dates p {font-size:clamp(12px,3.5vw,14px)!important;line-height:1.6!important}
  }
}
