/*
Theme Name: HDES
Theme URI: https://hdes.com.ph
Author: HDES Philippines Inc.
Description: Block theme for HDES Philippines Inc. Pages are built from editable blocks; reusable sections are under Patterns > HDES sections; colours and fonts are in Styles.
Version: 1.0.1
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hdes
*/

/* ---------- Base ---------- */
:root {
	--hdes-radius: 22px;
	--hdes-radius-lg: 28px;
	--hdes-section: clamp(64px, 8vw, 112px);
	--hdes-shadow: 0 18px 40px rgba(18, 32, 43, 0.08);
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }
a { text-underline-offset: 3px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--wp--preset--color--green); outline-offset: 3px; border-radius: 6px; }
.hdes-main { min-height: 50vh; }
.hdes-main > .wp-block-post-content > *:first-child { margin-top: 0; }

/* ---------- Header ---------- */
/* Solid background: a blur filter here would trap the full-screen mobile menu inside the header. */
.hdes-site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .hdes-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .hdes-site-header { top: 46px; } }
.hdes-header__bar { min-height: 76px; gap: 24px; }
.hdes-logo { margin: 0; flex-shrink: 0; }
.hdes-logo img { width: 190px; display: block; }
.hdes-header__nav { gap: 28px; }
.hdes-nav { font-weight: 600; font-size: 16px; gap: 26px; }
.hdes-nav .wp-block-navigation-item__content { color: var(--wp--preset--color--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.hdes-nav .wp-block-navigation-item__content:hover,
.hdes-nav .wp-block-navigation-item__content[aria-current="page"] { color: var(--wp--preset--color--blue); border-bottom-color: var(--wp--preset--color--green); }
.hdes-header__cta .wp-block-button__link { padding: 11px 20px; font-size: 15px; }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 24px !important; background: #fff; text-align: left; --navigation-layout-justification-setting: flex-start; --navigation-layout-justify: flex-start; --navigation-layout-align: flex-start; }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; justify-content: flex-start !important; }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 56px; align-items: flex-start !important; }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start !important; gap: 4px; width: 100%; }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid var(--wp--preset--color--line); }
.hdes-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--heading); font-weight: 400; font-size: 24px; padding: 14px 0; display: block; border-bottom: 0; }
.hdes-nav .wp-block-navigation__responsive-container-close { top: 24px !important; right: 24px !important; }
.wp-block-navigation__responsive-container-open { padding: 10px; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; }
@media (max-width: 900px) {
	.hdes-lang a { padding: 0 10px; min-height: 36px; }
	.hdes-header__bar { gap: 12px; }
	.hdes-header__nav { gap: 10px; }
	.hdes-header__nav .hdes-lang { order: -1; }
	.hdes-site-header .hdes-header__cta { display: none !important; }
	.hdes-logo img { width: 150px; }
}
@media (max-width: 400px) {
	.hdes-logo img { width: 128px; }
	.hdes-lang { font-size: 13px; }
	.hdes-lang a { padding: 0 8px; }
}

/* ---------- Language switch (EN | 한국어) ---------- */
.hdes-lang { display: flex; margin: 0; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; overflow: hidden; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.hdes-lang a { display: flex; align-items: center; min-height: 40px; padding: 0 13px; color: var(--wp--preset--color--ink); text-decoration: none; }
.hdes-lang a:hover { background: var(--wp--preset--color--tint); }
.hdes-lang a[aria-current="true"] { background: var(--wp--preset--color--ink); color: #fff; }

/* ---------- Korean page ---------- */
:lang(ko) body, html[lang="ko"] body { font-family: 'Noto Sans KR', var(--wp--preset--font-family--body); word-break: keep-all; }
html[lang="ko"] :where(h1, h2, h3, h4, .hdes-fact__value, .hdes-eyebrow) { font-family: 'Noto Sans KR', var(--wp--preset--font-family--heading); letter-spacing: -0.01em; }
html[lang="ko"] h1 { font-weight: 300; line-height: 1.25; font-size: clamp(32px, 3.5vw, 48px); }
html[lang="ko"] h2 { font-weight: 300; line-height: 1.3; font-size: clamp(26px, 2.8vw, 38px); }
html[lang="ko"] .hdes-eyebrow { letter-spacing: 0.08em; }
/* Korean breaks lines between words, never inside one (WordPress headings default to break-word). */
html[lang="ko"] :is(h1, h2, h3, h4, p, li) { word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- Line animation (added by assets/js/hdes.js; desktop only) ---------- */
.hdes-hero, .hdes-section--head { position: relative; overflow: hidden; }
.hdes-arcs { position: absolute; z-index: 0; pointer-events: none; max-width: none !important; margin: 0 !important; left: 0; right: 0; width: 100%; }
.hdes-arcs--head { top: 16px; height: calc(100% - 16px); }
.hdes-arcs--hero { bottom: 0; height: 128px; }
.hdes-hero > *:not(.hdes-arcs), .hdes-section--head > *:not(.hdes-arcs) { position: relative; z-index: 1; }
.hdes-hero.has-arcs { padding-bottom: clamp(88px, 9vw, 128px); }
@media (max-width: 720px) { .hdes-arcs { display: none; } .hdes-hero.has-arcs { padding-bottom: clamp(48px, 6vw, 88px); } }

/* ---------- Sections ---------- */
.hdes-section { padding-top: var(--hdes-section); padding-bottom: var(--hdes-section); }
.hdes-section--tight { padding-top: 0; padding-bottom: var(--hdes-section); }
.hdes-section--head { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(32px, 4vw, 56px); }
.hdes-section--note { padding-top: clamp(28px, 4vw, 44px); padding-bottom: clamp(28px, 4vw, 44px); }
/* Two white sections in a row share one gap instead of two. */
.hdes-section:not(.has-background) + .hdes-section:not(.has-background):not(.hdes-hero) { padding-top: 0; }
.hdes-measure { max-width: 680px; }
.hdes-center { text-align: center; margin-left: auto !important; margin-right: auto !important; }

.hdes-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--wp--preset--color--blue); }
.hdes-eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--wp--preset--color--green); flex-shrink: 0; }
.hdes-eyebrow.has-text-align-center { justify-content: center; }
.hdes-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.6; color: var(--wp--preset--color--body); max-width: 680px; }
.hdes-small { font-size: 14px; color: var(--wp--preset--color--muted); }
/* Narrow text blocks line up with the section's left edge (1240px wide sections) instead of being centred. */
.hdes-section.is-layout-constrained > .hdes-lead, .hdes-section.is-layout-constrained > .hdes-measure { margin-left: max(0px, calc((100% - 1240px) / 2)) !important; margin-right: auto !important; }
h1.hdes-title, .hdes-title { margin-top: 0; }
.hdes-title strong, h1 strong, h2 strong { font-weight: 400; color: var(--wp--preset--color--blue); }

/* ---------- Hero ---------- */
.hdes-hero { padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }
.hdes-hero .wp-block-buttons { margin-top: 32px; }

/* ---------- Images ---------- */
.hdes-photo img { border-radius: var(--hdes-radius-lg); display: block; width: 100%; }
.hdes-photo figcaption { margin-top: 12px; }
.hdes-ratio-43 img { aspect-ratio: 4 / 3; object-fit: cover; }
.hdes-ratio-169 img { aspect-ratio: 16 / 9; object-fit: cover; }
.hdes-ratio-45 img { aspect-ratio: 4 / 5; object-fit: cover; }
.hdes-ratio-32 img { aspect-ratio: 3 / 2; object-fit: cover; }
.hdes-map img { border-radius: var(--hdes-radius-lg); border: 1px solid var(--wp--preset--color--line); }

/* ---------- Block styles (Card / Panel / Blue band) ---------- */
.is-style-hdes-card { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: var(--hdes-radius); padding: 28px; transition: box-shadow .25s ease, transform .25s ease; }
.is-style-hdes-card:hover { box-shadow: var(--hdes-shadow); }
.is-style-hdes-card > .wp-block-image:first-child { margin: -28px -28px 22px; }
.is-style-hdes-card > .wp-block-image:first-child img { border-radius: var(--hdes-radius) var(--hdes-radius) 0 0; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; display: block; }
.is-style-hdes-card h3 { margin-top: 0; }
.is-style-hdes-card p:last-child { margin-bottom: 0; }
.is-style-hdes-panel { background: var(--wp--preset--color--tint); border-radius: var(--hdes-radius-lg); padding: clamp(28px, 4vw, 48px); }
.is-style-hdes-band { background: var(--wp--preset--color--blue); color: #fff; border-radius: var(--hdes-radius-lg); padding: clamp(32px, 5vw, 64px); position: relative; overflow: hidden; }
.is-style-hdes-band::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(90, 179, 78, 0.28); pointer-events: none; }
.is-style-hdes-band :where(h1, h2, h3, p, a) { color: #fff; position: relative; z-index: 1; }
.is-style-hdes-band .hdes-eyebrow { color: #CFE9F6; }
.is-style-hdes-band .wp-block-buttons { position: relative; z-index: 1; }
.is-style-hdes-band .wp-block-button__link { background: #fff; color: var(--wp--preset--color--blue); }
.is-style-hdes-band .wp-block-button__link:hover { background: var(--wp--preset--color--sage); color: var(--wp--preset--color--blue-deep); }
.is-style-hdes-band .is-style-outline .wp-block-button__link { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }

.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--blue); border: 1.5px solid var(--wp--preset--color--blue); padding: 12.5px 24.5px; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--blue-deep); }

/* ---------- Grids of cards ---------- */
.hdes-grid { gap: 20px; }
.hdes-grid > * { margin: 0 !important; }

/* ---------- Facts ---------- */
.hdes-facts { gap: 0; border-top: 1px solid var(--wp--preset--color--line); border-left: 1px solid var(--wp--preset--color--line); }
.hdes-fact { padding: 24px 26px; border-right: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); margin: 0 !important; }
.hdes-fact__value { margin: 0; font-family: var(--wp--preset--font-family--heading); font-weight: 300; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; color: var(--wp--preset--color--ink); letter-spacing: -0.02em; }
.hdes-fact__value small { font-size: 0.45em; color: var(--wp--preset--color--muted); letter-spacing: 0; }
.hdes-fact:not(.hdes-fact--text) .hdes-fact__value { white-space: nowrap; font-size: clamp(28px, 2.9vw, 40px); }
.hdes-fact--text .hdes-fact__value { font-family: var(--wp--preset--font-family--body); font-size: 18px; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.hdes-fact__label { margin: 8px 0 0 !important; font-size: 14px; color: var(--wp--preset--color--muted); }
.hdes-fact--accent .hdes-fact__value { color: var(--wp--preset--color--blue); }

/* ---------- Steps ---------- */
.hdes-step__num { margin: 0 0 14px; font-family: var(--wp--preset--font-family--heading); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; color: var(--wp--preset--color--green-deep); }
.hdes-step h3 { font-size: 20px; }

/* ---------- Checklist ---------- */
.hdes-checks, .is-style-hdes-checks { list-style: none; padding-left: 0; }
.hdes-checks li, .is-style-hdes-checks li { position: relative; padding-left: 34px; margin-bottom: 12px; }
.hdes-checks li::before, .is-style-hdes-checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--wp--preset--color--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }

/* ---------- Timeline ---------- */
.hdes-timeline { list-style: none; padding-left: 0; margin: 0; border-left: 2px solid var(--wp--preset--color--line); }
.hdes-timeline li { position: relative; padding: 0 0 28px 30px; }
.hdes-timeline li:last-child { padding-bottom: 0; }
.hdes-timeline li::before { content: ""; position: absolute; left: -9px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--wp--preset--color--blue); }
.hdes-timeline li:last-child::before { background: var(--wp--preset--color--green); border-color: var(--wp--preset--color--green); box-shadow: 0 0 0 6px rgba(90, 179, 78, 0.18); }
.hdes-timeline strong { display: block; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wp--preset--color--blue); margin-bottom: 4px; }

/* ---------- Gallery ---------- */
.hdes-gallery { gap: 16px; }
.hdes-gallery .wp-block-image { margin: 0 !important; }
.hdes-gallery img { border-radius: 18px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; display: block; }
.hdes-gallery figcaption { font-size: 14px; margin-top: 10px; }

/* ---------- News cards ---------- */
.hdes-news-card { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: var(--hdes-radius); overflow: hidden; height: 100%; transition: box-shadow .25s ease; }
.hdes-news-card:hover { box-shadow: var(--hdes-shadow); }
.hdes-news-card .wp-block-post-featured-image { margin: 0; }
.hdes-news-card .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; display: block; }
.hdes-news-card__body { padding: 22px 24px 26px; }
.hdes-news-card__body > * { margin-top: 0; }
.hdes-news-card__title { font-size: 20px; line-height: 1.35; font-weight: 400; margin-top: 8px !important; }
.hdes-news-card__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.hdes-news-card__title a:hover { color: var(--wp--preset--color--blue); }
.wp-block-query .wp-block-post-template.is-layout-grid { gap: 20px; }
.hdes-pagination { margin-top: 40px; font-weight: 600; }

/* ---------- Project cards (Projects page) ---------- */
.hdes-project-card { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: var(--hdes-radius-lg); overflow: hidden; }
.hdes-project-card .wp-block-post-featured-image { margin: 0; height: 100%; }
.hdes-project-card .wp-block-post-featured-image img { height: 100%; min-height: 320px; object-fit: cover; width: 100%; display: block; }
.hdes-project-card__body { padding: clamp(28px, 4vw, 48px); }
.hdes-project-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.hdes-project-card .wp-block-columns { gap: 0; margin: 0; }
.hdes-badge { display: inline-block; margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--wp--preset--color--sage); color: var(--wp--preset--color--green-deep); font-size: 14px; font-weight: 600; }

/* ---------- Article (news post) ---------- */
.hdes-article__head { padding-top: clamp(40px, 5vw, 72px); }
.hdes-backlink a { font-weight: 600; text-decoration: none; }
.hdes-article__image img { border-radius: var(--hdes-radius-lg); max-height: 560px; object-fit: cover; width: 100%; }
.hdes-article__body { font-size: 19px; line-height: 1.75; padding-bottom: 24px; }
.hdes-more-news { padding-top: var(--hdes-section); padding-bottom: var(--hdes-section); }

/* ---------- Contact form ---------- */
.hdes-form { display: grid; gap: 18px; }
.hdes-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.hdes-form label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; color: var(--wp--preset--color--ink); }
.hdes-form .hdes-form__optional { font-weight: 400; color: var(--wp--preset--color--muted); }
.hdes-form input[type=text], .hdes-form input[type=email], .hdes-form input[type=tel], .hdes-form select, .hdes-form textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 13px 16px; border: 1px solid #C5D1D9; border-radius: 12px; background: #fff; color: var(--wp--preset--color--ink); min-height: 48px; box-sizing: border-box; width: 100%; }
.hdes-form textarea { min-height: 150px; resize: vertical; }
.hdes-form input:focus, .hdes-form select:focus, .hdes-form textarea:focus { border-color: var(--wp--preset--color--blue); outline: 3px solid rgba(6, 102, 152, 0.15); outline-offset: 0; }
.hdes-form__consent { flex-direction: row !important; align-items: flex-start; gap: 12px !important; font-weight: 400 !important; font-size: 14px !important; color: var(--wp--preset--color--body) !important; line-height: 1.55; }
.hdes-form__consent input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; accent-color: var(--wp--preset--color--blue); }
.hdes-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.hdes-form button { justify-self: start; font: inherit; font-weight: 600; font-size: 16px; padding: 15px 28px; border: 0; border-radius: 999px; background: var(--wp--preset--color--blue); color: #fff; cursor: pointer; }
.hdes-form button:hover { background: var(--wp--preset--color--blue-deep); }
.hdes-notice { padding: 14px 18px; border-radius: 14px; font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
.hdes-notice--ok { background: var(--wp--preset--color--sage); color: var(--wp--preset--color--green-deep); }
.hdes-notice--err { background: #FDECEC; color: #8A1C1C; }
.hdes-contact-list p { margin: 0 0 18px; }
.hdes-contact-list strong { display: block; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin-bottom: 4px; }

/* ---------- Footer ---------- */
.hdes-site-footer { background: var(--wp--preset--color--tint); border-top: 1px solid var(--wp--preset--color--line); }
.hdes-footer { padding-top: 64px; padding-bottom: 28px; font-size: 15px; }
.hdes-footer h4 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin: 0 0 14px; font-weight: 600; font-family: var(--wp--preset--font-family--body); }
.hdes-footer p { margin: 0 0 10px; }
.hdes-footer a { color: var(--wp--preset--color--ink); text-decoration: none; }
.hdes-footer a:hover { color: var(--wp--preset--color--blue); text-decoration: underline; }
.hdes-footer__logo img { width: 200px; }
.hdes-footer__bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--wp--preset--color--line); font-size: 14px; color: var(--wp--preset--color--muted); gap: 12px 24px; }
.hdes-footer__bottom p { margin: 0; }

/* ---------- Motion (added by assets/js/hdes.js; off for reduced motion) ---------- */
.hdes-motion .hdes-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.hdes-motion .hdes-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.hdes-motion .hdes-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Print ---------- */
@media print {
	.hdes-site-header, .hdes-site-footer, .hdes-form { display: none; }
}
