/* Attaya V56 - cross-device responsive hardening */
:root{--attaya-safe-inline:max(14px,env(safe-area-inset-left));--attaya-mobile-header:72px}
html{max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:92px}
body{max-width:100%;overflow-x:clip;min-width:280px}
@supports not (overflow:clip){html,body{overflow-x:hidden}}
img,video,iframe,canvas,picture,svg{max-width:100%}
img,video{height:auto}
input,select,textarea,button{max-width:100%}
button,a{-webkit-tap-highlight-color:transparent}
.attaya-public,.attaya-green-home,.attaya-about-page,.attaya-signature-home{max-width:100%;overflow-x:clip}
.attaya-container,.container{max-width:100%}
.dynamic-home-section *,.attaya-section *,.attaya-card *,.project-card *,.urgent-card *,.news-card *{min-width:0}
.section-title,.section-copy,.project-card h3,.urgent-card h3,.news-card h3,.attaya-footer p,.attaya-footer a{overflow-wrap:anywhere;word-break:normal}

/* Stable media and layout before image loading */
.project-image,.project-media,.urgent-card-media,.news-media,.attaya-news-image,.donation-card>img,.attaya-donation-photo,.ahs-media{background:#eaf1ec}
.project-image img,.project-media img,.urgent-card-media img,.news-media img,.attaya-news-image img{width:100%;height:100%;object-fit:cover}

/* Generic public header */
@media(max-width:1100px){
  .attaya-header-inner,.header-inner{gap:12px!important}
  .attaya-nav,.main-nav{gap:16px}
  .attaya-nav a,.main-nav a{font-size:13px}
}

@media(max-width:980px){
  .attaya-header,.site-header{min-height:var(--attaya-mobile-header);height:auto!important;position:sticky;top:0;z-index:200;background:#fff}
  .attaya-header-inner,.header-inner{min-height:var(--attaya-mobile-header);height:auto!important;width:min(100% - 24px,1240px)!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;padding-block:8px}
  .attaya-brand,.brand{min-width:0!important;max-width:min(62vw,260px);overflow:hidden}
  .attaya-brand-copy,.brand span{min-width:0}
  .attaya-brand-copy strong,.brand strong{font-size:clamp(13px,3.4vw,17px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .attaya-brand-copy small,.brand small{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .attaya-brand-logo-image,.brand img{max-height:52px!important;max-width:min(48vw,220px)!important;width:auto!important;object-fit:contain!important}
  .attaya-header-actions{display:flex!important;align-items:center;gap:5px!important;margin:0!important;min-width:max-content}
  .green-preferences{display:flex;align-items:center;margin:0!important}
  .attaya-header-tools{display:flex;gap:4px}
  .attaya-header-icon-button,.menu-toggle,.attaya-menu-toggle{width:40px!important;height:40px!important;min-width:40px;border-radius:12px!important;padding:0!important;display:grid!important;place-items:center}
  .menu-toggle,.attaya-menu-toggle{order:10}
  .attaya-pref>summary{min-width:38px!important;width:38px;height:40px;padding:0!important;display:grid!important;place-items:center}
  .attaya-pref>summary span,.attaya-pref>summary .fa-chevron-down{display:none!important}
  .main-nav,.attaya-nav{position:fixed!important;top:calc(var(--attaya-mobile-header) + env(safe-area-inset-top));inset-inline:12px!important;bottom:auto!important;max-height:calc(100dvh - var(--attaya-mobile-header) - 24px);overflow-y:auto;overscroll-behavior:contain;display:none!important;flex-direction:column!important;align-items:stretch!important;gap:2px!important;background:#fff!important;border:1px solid #dfe9e3!important;border-radius:18px!important;padding:10px!important;box-shadow:0 24px 65px rgba(5,40,30,.22)!important;z-index:500!important}
  .main-nav.open,.attaya-nav.open{display:flex!important}
  .main-nav a,.attaya-nav a{display:flex!important;align-items:center;min-height:46px;padding:10px 14px!important;border-radius:11px;font-size:14px!important;white-space:normal!important}
  .main-nav a:hover,.main-nav a.active,.attaya-nav a:hover,.attaya-nav a.active{background:#eef7f1;color:#0d513d}
  .main-nav a::after,.attaya-nav a::after{display:none!important}
  body.attaya-mobile-nav-open{overflow:hidden;touch-action:none}
}

/* Hero */
@media(max-width:760px){
  .attaya-hero-slider,.ahs-track,.ahs-slide{min-height:clamp(500px,78svh,620px)!important}
  .ahs-content-shell{min-height:inherit!important;padding:76px 0 78px!important;align-items:flex-end!important}
  .ahs-copy{width:100%!important;max-width:680px;padding-inline:10px!important;text-align:center!important;margin-inline:auto}
  .ahs-eyebrow{font-size:11px;max-width:90%;white-space:normal;text-align:center}
  .ahs-title{font-size:clamp(34px,10.5vw,48px)!important;line-height:1.15!important;letter-spacing:-.4px!important;text-wrap:balance}
  .ahs-description{font-size:14px!important;line-height:1.85!important;max-width:94%!important;margin-inline:auto!important}
  .ahs-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important;width:min(100%,420px);margin-inline:auto}
  .ahs-actions .btn,.ahs-primary,.ahs-secondary{width:100%!important;min-width:0!important;min-height:48px;padding-inline:10px!important;white-space:normal;text-align:center}
  .ahs-bottom-bar{padding-inline:18px!important;bottom:22px!important}
  .ahs-counter{font-size:11px}.ahs-counter b{font-size:17px}
  .ahs-layer{max-width:84vw;max-height:45vh;overflow:hidden}
}
@media(max-width:390px){.ahs-actions{grid-template-columns:1fr}.attaya-hero-slider,.ahs-track,.ahs-slide{min-height:590px!important}}

/* Trust / values */
@media(max-width:760px){
  .values-wrap.dynamic-home-section{margin-top:0!important;padding-top:18px!important}
  .values-card,.values-wrap.dynamic-home-section .values-card,.attaya-trust-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:10px!important;gap:0!important;border-radius:18px!important}
  .value-item,.attaya-trust-item{min-height:155px!important;padding:18px 10px!important;border:0!important;border-bottom:1px solid #e5ece7!important}
  .value-item:nth-child(odd),.attaya-trust-item:nth-child(odd){border-inline-end:1px solid #e5ece7!important}
  .value-item:nth-last-child(-n+2),.attaya-trust-item:nth-last-child(-n+2){border-bottom:0!important}
  .value-item::after,.attaya-trust-item::after{display:none!important}
  .value-item h3,.attaya-trust-item h3{font-size:16px!important}
  .value-item p,.attaya-trust-item p{font-size:12px!important;line-height:1.7!important}
}
@media(max-width:360px){.values-card,.values-wrap.dynamic-home-section .values-card,.attaya-trust-grid{grid-template-columns:1fr!important}.value-item,.attaya-trust-item{border-inline-end:0!important;border-bottom:1px solid #e5ece7!important}.value-item:last-child,.attaya-trust-item:last-child{border-bottom:0!important}}

/* Section headers and actions */
@media(max-width:760px){
  .dynamic-home-section{padding-top:clamp(42px,var(--section-padding-top,58px),68px)!important;padding-bottom:clamp(42px,var(--section-padding-bottom,58px),68px)!important}
  .dynamic-home-section>.container,.attaya-container,.container{width:min(100% - 28px,var(--section-container-width,1240px))!important}
  .section-head,.urgent-head,.attaya-heading{display:grid!important;grid-template-columns:1fr!important;align-items:start!important;gap:16px!important;margin-bottom:22px!important}
  .section-head .btn,.urgent-header-button,.attaya-heading .attaya-btn{width:100%!important;max-width:100%!important;min-width:0!important}
  .section-title,.attaya-heading-copy h2{font-size:clamp(27px,8vw,36px)!important;line-height:1.3!important}
  .section-copy,.attaya-heading-copy p{font-size:14px!important;line-height:1.8!important}
}

/* Project carousel */
@media(max-width:760px){
  .project-carousel{width:100%;overflow:visible}
  .project-carousel-viewport{overflow-x:auto!important;scroll-snap-type:x mandatory;scroll-padding-inline:0;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .project-carousel-viewport::-webkit-scrollbar{display:none}
  .project-carousel-track{gap:14px!important;padding-inline:0!important}
  .project-carousel-track .project-card{flex:0 0 100%!important;width:100%!important;scroll-snap-align:start}
  .project-card{border-radius:18px!important;overflow:hidden!important}
  .project-image,.project-media,.attaya-project-media{height:clamp(210px,56vw,300px)!important}
  .project-body,.attaya-project-body{padding-inline:16px!important}
  .project-card h3,.attaya-project-body h3{font-size:18px!important;line-height:1.5!important}
  .project-funding-panel{font-size:12px}
  .project-carousel-controls{display:flex!important;justify-content:center!important;align-items:center!important;gap:12px!important;margin-top:20px!important}
  .project-carousel-dots{max-width:58vw;overflow:hidden;display:flex;justify-content:center}
}

/* Urgent appeals */
@media(max-width:760px){
  .urgent-grid,.urgent-projects[data-count="1"] .urgent-grid,.urgent-projects[data-count="2"] .urgent-grid{grid-template-columns:1fr!important;width:100%;justify-content:stretch!important}
  .urgent-card{width:100%;max-width:100%;border-radius:22px!important}
  .urgent-card-media{height:clamp(210px,62vw,300px)!important}
  .urgent-badge{top:12px!important;inset-inline-start:12px!important;padding:8px 12px!important;font-size:13px}
  .urgent-card-body{padding:20px 16px!important}
  .urgent-card-body h3{font-size:20px!important}
  .urgent-card-body>p{min-height:0!important;font-size:14px!important}
  .urgent-progress-meta{gap:8px!important;font-size:11px!important;flex-wrap:wrap}
  .urgent-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
  .urgent-actions>*{width:100%!important;min-width:0!important;padding-inline:8px!important}
}
@media(max-width:380px){.urgent-actions{grid-template-columns:1fr!important}}

/* Stats */
@media(max-width:760px){
  .stats.dynamic-home-section .stats-grid,.stats-grid,.attaya-impact-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important}
  .stat,.attaya-impact-item{min-height:145px;padding:20px 10px!important;border:0!important;border-bottom:1px dashed rgba(255,255,255,.25)!important}
  .stat:nth-child(odd),.attaya-impact-item:nth-child(odd){border-inline-end:1px dashed rgba(255,255,255,.25)!important}
  .stat:last-child:nth-child(odd),.attaya-impact-item:last-child:nth-child(odd){grid-column:1/-1;border-inline-end:0!important}
  .stat::after,.attaya-impact-item::after{display:none!important}
  .stat strong,.attaya-impact-item strong{font-size:clamp(30px,9vw,40px)!important}
  .stat span,.attaya-impact-item span{font-size:14px!important}
}

/* Donation section */
@media(max-width:760px){
  .donation-section{margin-top:0!important;padding-bottom:50px!important}
  .donation-card,.attaya-donation-card{display:grid!important;grid-template-columns:1fr!important;gap:18px!important;padding:14px!important;border-radius:20px!important;direction:rtl!important}
  .donation-card>img,.attaya-donation-photo{width:100%!important;height:clamp(210px,55vw,290px)!important;border-radius:15px!important;overflow:hidden}
  .donation-copy h2,.attaya-donation-copy h2{font-size:clamp(25px,7vw,32px)!important}
  .amounts,.attaya-donation-amounts{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%}
  .amount,.attaya-amount-btn{min-width:0!important;width:100%!important}
}

/* News */
@media(max-width:760px){
  .news-grid,.attaya-news-grid,.news.dynamic-home-section .news-grid{grid-template-columns:1fr!important;gap:18px!important}
  .news-card,.attaya-news-card{border-radius:18px!important;overflow:hidden!important}
  .news-media,.attaya-news-image{height:clamp(210px,55vw,290px)!important}
  .news-body,.attaya-news-body{padding:18px!important}
  .news-body h3,.attaya-news-body h3{font-size:19px!important}
  .date-box,.attaya-news-date{inset-inline-start:12px!important;inset-inline-end:auto!important;top:12px!important}
}

/* Footer */
@media(max-width:900px){
  .attaya-footer-grid,.footer-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:30px!important}
}
@media(max-width:600px){
  .attaya-footer,.site-footer{padding-top:42px!important}
  .attaya-footer-grid,.footer-grid{grid-template-columns:1fr!important;gap:30px!important}
  .attaya-footer-brand,.footer-brand{align-items:center!important;flex-wrap:wrap}
  .attaya-footer-brand img,.footer-brand img{max-width:min(74vw,280px)!important;height:auto!important;max-height:120px!important}
  .attaya-newsletter,.newsletter-form{display:grid!important;grid-template-columns:minmax(0,1fr) 52px!important;width:100%}
  .attaya-newsletter input,.newsletter-form input{min-width:0!important;width:100%!important}
  .attaya-footer-bottom,.footer-bottom{display:grid!important;grid-template-columns:1fr!important;text-align:center!important;justify-items:center;gap:14px!important;padding-block:18px!important}
  .attaya-footer-bottom-links,.footer-bottom-links{display:flex;flex-wrap:wrap;justify-content:center;gap:14px!important}
}

/* Forms, modals, reports and long content */
@media(max-width:760px){
  .modal-dialog,.attaya-modal-dialog{width:calc(100% - 16px)!important;max-height:calc(100dvh - 16px)!important;margin:8px auto!important;border-radius:18px!important}
  .modal-head,.modal-body{padding:16px!important}
  .donation-form-grid,.grid2,.grid3{grid-template-columns:1fr!important}
  .attaya-project-layout,.attaya-news-article-layout{grid-template-columns:1fr!important}
  .attaya-media-grid,.attaya-news-gallery{grid-template-columns:1fr!important}
  .attaya-news-gallery-item.video{grid-column:auto!important}
  .attaya-project-cover-card{width:100%!important;height:clamp(260px,75vw,360px)!important;transform:none!important}
  .attaya-search-overlay{padding-inline:8px!important}
  .attaya-search-panel{width:100%!important}
  .attaya-search-form{grid-template-columns:1fr!important}
  table{font-size:12px}
}

/* Landscape phones and short browser viewports */
@media(max-height:520px) and (orientation:landscape){
  .main-nav,.attaya-nav{max-height:calc(100dvh - 78px)}
  .attaya-hero-slider,.ahs-track,.ahs-slide{min-height:500px!important}
  .ahs-content-shell{padding-top:45px!important;padding-bottom:58px!important}
}

/* Safer behavior for older Safari */
@supports(height:100svh){.main-nav,.attaya-nav{max-height:calc(100svh - var(--attaya-mobile-header) - 24px)}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.project-card,.urgent-card,.news-card,.ahs-media img{transition:none!important;animation:none!important}}
