/*
Theme Name: Construction PH
Description: An editorial theme for practical construction guides in the Philippines.
Version: 1.0.2
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: construction-ph
*/

:root {
  --paper: #f7f5ed;
  --white: #fffefa;
  --ink: #192b24;
  --muted: #475c50;
  --green: #173e34;
  --forest: #112f28;
  --amber: #f3c45c;
  --line: #d7d9ce;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: var(--green); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid #9b6300; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.04em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.3rem); }
.wrap { width: min(100% - 3rem, 73rem); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; top: 1rem; left: 1rem; width: auto; height: auto; clip-path: none; padding: .75rem 1rem; background: var(--white); }

.site-head { background: var(--white); border-bottom: 1px solid var(--line); }
.site-head .wrap { min-height: 5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem 2rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; color: var(--ink); font-size: 1.06rem; font-weight: 780; letter-spacing: -.045em; }
.brand svg { flex: none; }
.brand small { display: block; color: var(--muted); font-size: .59rem; line-height: 1.1; font-weight: 720; letter-spacing: .15em; text-transform: uppercase; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .6rem clamp(1rem, 2.8vw, 2rem); margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding-block: .45rem; text-decoration: none; color: var(--ink); font-size: .85rem; font-weight: 660; }
.site-nav a:hover, .site-nav [aria-current=page] { text-decoration: underline; }
.eyebrow { font-size: .71rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 770; }
.eyebrow::before { display: inline-block; width: .55rem; height: .55rem; margin-right: .6rem; background: var(--amber); content: ""; vertical-align: .04em; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.85rem; padding: .6rem 1rem; gap: .6rem; background: var(--green); color: var(--white); border: 1px solid transparent; border-radius: .22rem; text-decoration: none; font-size: .88rem; font-weight: 720; cursor: pointer; }
.button:hover { background: var(--forest); color: #fff; }
.button--amber { background: var(--amber); color: var(--forest); }
.button--amber:hover { background: #ffda82; color: var(--forest); }
.button--outline { color: var(--white); background: transparent; border-color: #779c8c; }
.button--outline:hover { background: #244b40; }

.hero { color: var(--white); background: var(--forest); overflow: hidden; }
.hero :focus-visible, .site-foot :focus-visible { outline-color: var(--amber); }
.hero .wrap { min-height: 31rem; display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(0, .97fr); gap: clamp(1.6rem, 5vw, 5rem); align-items: center; padding-block: clamp(2.6rem, 6vw, 5.6rem); }
.hero .eyebrow { color: #e5d79f; }
.hero h1 { max-width: 13ch; margin: .85rem 0 1.12rem; font-size: clamp(3rem, 6vw, 5.65rem); line-height: .97; }
.hero .lede { max-width: 48ch; color: #dfebe3; font-size: clamp(.99rem, 1.7vw, 1.13rem); }
.hero-actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.65rem; }
.hero-art { padding: .8rem; border: 1px solid #456c5c; background: #15392f; }
.hero-art img { width: 100%; }
.hero-art figcaption { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem .35rem .1rem; color: #c1d8cb; font-size: .64rem; font-weight: 650; letter-spacing: .10em; text-transform: uppercase; }

.section { padding-block: clamp(2.4rem, 5.5vw, 4.8rem); }
.section--white { background: var(--white); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .8rem 2rem; margin-bottom: 1.45rem; }
.section-head h2 { margin-top: .35rem; }
.section-head p:not(.eyebrow) { max-width: 45ch; color: var(--muted); }
.topic-grid, .post-grid { display: grid; gap: .9rem; }
.topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.topic { display: flex; flex-direction: column; gap: .65rem; min-height: 10.5rem; border: 1px solid var(--line); background: var(--white); padding: 1.15rem; text-decoration: none; }
.topic:hover { border-color: var(--green); }
.topic-code { width: fit-content; padding: .15rem .4rem; background: #efe8cc; color: var(--forest); font: 700 .72rem/1.5 var(--sans); letter-spacing: .08em; }
.topic strong { color: var(--ink); font-size: 1.06rem; }
.topic p { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { display: flex; flex-direction: column; align-items: start; padding: 1.3rem; min-height: 12.2rem; border: 1px solid var(--line); border-top: .25rem solid #829c87; background: var(--white); }
.post-card:nth-child(3n+2) { border-top-color: #cc9d42; }
.post-card:nth-child(3n+3) { border-top-color: #7f9f9e; }
.post-card .card-title { margin: .58rem 0 .65rem; font: 500 1.42rem/1.15 var(--serif); letter-spacing: -.025em; }
.post-card .card-title a { color: var(--ink); text-decoration: none; }
.post-card .card-title a:hover { text-decoration: underline; }
.post-card p:not(.eyebrow) { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.post-card time { display: block; margin-top: auto; padding-top: .8rem; color: var(--muted); font-size: .72rem; }
.text-link { font-size: .88rem; font-weight: 720; }
.search-form { display: flex; width: min(100%, 30rem); gap: .5rem; margin-top: 1rem; }
.search-form label { flex: 1; min-width: 0; }
.search-form input, .cost-estimator input { width: 100%; min-height: 2.85rem; padding: .55rem .65rem; font: inherit; background: var(--white); color: var(--ink); border: 1px solid #839486; border-radius: .22rem; }
.empty { padding-block: 2rem; }

.article-head { padding-block: clamp(2.2rem, 5vw, 4.35rem); background: #eaece0; border-bottom: 1px solid var(--line); }
.article-head .wrap { max-width: 54rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; color: var(--muted); font-size: .79rem; margin-bottom: 1.2rem; }
.article-head h1 { max-width: 19ch; margin: .55rem 0 .85rem; font-size: clamp(2.3rem, 5.6vw, 4.7rem); line-height: 1.03; }
.article-head .summary { max-width: 65ch; color: var(--muted); font-size: 1.08rem; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; margin-top: 1rem; color: var(--muted); font-size: .79rem; }
.prose { max-width: 47rem; padding-block: clamp(1.75rem, 5vw, 3.65rem); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2rem; font-size: clamp(1.62rem, 3vw, 2.35rem); }
.prose h3 { margin-top: 1.25rem; font-size: 1.12rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li + li { margin-top: .35rem; }
.prose a { overflow-wrap: anywhere; }
.prose figure { max-width: 100%; }
.prose .wp-block-table { overflow: auto; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5rem .65rem; vertical-align: top; text-align: left; }
.prose th { background: #eaece0; }
.prose .quick-answer, .cost-estimator { border: 1px solid #c5d0c5; background: var(--white); padding: 1.15rem 1.3rem; }
.prose .quick-answer { border-left: .25rem solid var(--green); }
.quick-answer h2 { font: 760 .72rem/1.5 var(--sans); letter-spacing: .13em; text-transform: uppercase; margin: 0 0 .4rem; }
.quick-answer p { font-weight: 570; }
.cost-estimator h2 { margin: 0 0 .6rem; }
.cost-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-block: 1rem; }
.cost-fields label { font-size: .88rem; font-weight: 650; }
.cost-fields input { display: block; margin-top: .2rem; }
.cost-estimator output { display: block; margin-top: .65rem; font-weight: 720; }
.cost-estimator small { color: var(--muted); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.pagination .page-numbers { padding: .35rem .7rem; border: 1px solid var(--line); }

.site-foot { background: var(--forest); color: #e0eae4; padding-block: 2rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 1rem 2rem; }
.site-foot a { color: var(--white); }
.site-foot p { color: #c9dbd0; max-width: 55ch; font-size: .83rem; }
.foot-links { display: flex; gap: .5rem 1rem; flex-wrap: wrap; font-size: .83rem; }

@media (max-width: 54rem) {
  .topic-grid, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .wrap { gap: 1.6rem; min-height: unset; }
}
@media (max-width: 42rem) {
  .wrap { width: calc(100% - 2rem); }
  .site-head .wrap { gap: .2rem; padding-block: .7rem; }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { gap: .15rem 1rem; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .hero-art { max-width: 34rem; }
}
@media (max-width: 29rem) {
  .post-grid, .cost-fields { grid-template-columns: 1fr; }
  .topic { padding: .78rem; min-height: 0; }
  .topic strong { font-size: .94rem; }
  .post-card { min-height: 0; }
}
