/* Tapa Valla Kultuurikeskus – content sections (house "Maja lugu" blocks and TVK page blocks).
   Uses the tokens from main.css. Loaded only on pages that contain these blocks. */

.sec { padding-block: calc(var(--section-y) * .7); }
.sec--inline { padding-block: 0; margin-block: clamp(32px, 5vw, 64px); }
.entry-content > .sec--inline:first-child { margin-top: 8px; }
.sec--bg-hall { background: var(--c-sand); }
.sec--bg-toon { background: var(--b-mat); }
.sec--inline.sec--bg-hall, .sec--inline.sec--bg-toon { padding: clamp(24px, 4vw, 56px); border-radius: var(--r-xl); }
.sec__title { font-size: var(--fs-h2); margin: 0 0 .55em; }
.sec__title--small { font-family: var(--f-body); font-size: var(--fs-h4); letter-spacing: 0; color: var(--c-muted); }
.sec__intro { max-width: var(--measure); margin: -.2em 0 1.6em; color: var(--c-muted); font-size: var(--fs-lead); }
.sec-narrow { max-width: 880px; }
.sec .entry-content { max-width: var(--measure); }
.sec .entry-content > :last-child, .sec p:last-child { margin-bottom: 0; }
.entry-content .sec h2 { margin-top: 0; }
.entry-content .sec :is(ul.facts-grid, ul.info-cards, ul.logo-row, ol.timeline, ul.gallery-grid) { padding-left: 0; }
.entry-content .sec :is(.facts-grid, .info-cards, .timeline, .logo-row, .gallery-grid) li + li { margin-top: 0; }

.sec--lead + .sec { padding-top: 0; }
.sec-lead { max-width: 920px; }
.sec-lead__title { font-size: var(--fs-h2); }
.sec-lead__text { margin: 0; font-size: clamp(1.3125rem, 1.1rem + .9vw, 1.75rem); line-height: 1.5; color: var(--c-text); }
.sec-lead__buttons { margin-top: 28px; }

.sec-split { display: grid; gap: clamp(24px, 4vw, 64px); align-items: center; }
.sec-split__media { margin: 0; }
.sec-split__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xl); box-shadow: inset 0 0 0 1px rgba(29,31,43,.06); }
.sec-split__body .entry-content { max-width: 60ch; }
.sec-split__body .btn { margin-top: 24px; }
@media (min-width: 900px) {
	.sec-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.sec-split--img-right .sec-split__media { order: 2; }
}
.sec-text--cols .entry-content { max-width: none; }
@media (min-width: 960px) { .sec-text--cols .entry-content { columns: 2; column-gap: 56px; } .sec-text--cols .entry-content > * { break-inside: avoid; } }

.facts-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin: 0; padding: 0; list-style: none; }
.fact { display: flex; flex-direction: column; gap: 6px; padding: 20px 0 0; border-top: 4px solid var(--b-fill); }
.fact__number { font: 700 clamp(2.25rem, 1.8rem + 1.8vw, 3.5rem) / 1.05 var(--f-display); letter-spacing: -.02em; color: var(--b-ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fact__label { color: var(--c-text); line-height: 1.45; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline__item { position: relative; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 24px; padding-bottom: 28px; }
.timeline__item::before { content: ""; position: absolute; left: calc(5.5rem + 11px); top: 12px; bottom: 0; width: 2px; background: var(--c-line); }
.timeline__item:last-child::before { display: none; }
.timeline__year { font: 700 1.5rem / 1.3 var(--f-display); color: var(--b-ink); text-align: right; font-variant-numeric: tabular-nums; }
.timeline__body { position: relative; padding-left: 28px; }
.timeline__body::before { content: ""; position: absolute; left: 4px; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: var(--b-fill); box-shadow: 0 0 0 4px var(--c-bg); }
.sec--bg-hall .timeline__body::before { box-shadow: 0 0 0 4px var(--c-sand); }
.timeline__body h3 { margin: 0 0 4px; font-family: var(--f-body); font-size: var(--fs-h4); letter-spacing: 0; }
.timeline__body p { margin: 0; color: var(--c-muted); }

.info-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0; padding: 0; list-style: none; }
@media (min-width: 1100px) {
	.info-cards:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.info-cards:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.info-cards:has(> li:nth-child(7)) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.info-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px; background: #fff; border: var(--bd-card); border-radius: var(--r-lg); transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.sec--bg-hall .info-card, .sec--bg-toon .info-card { border-color: transparent; }
.info-card__icon { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: var(--b-tint); color: var(--b-ink); margin-bottom: 6px; }
.info-card h3 { margin: 0; font-size: var(--fs-card); }
.info-card h3 a { color: var(--c-text); text-decoration: none; }
.info-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.info-card.has-link:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.info-card.has-link:hover h3 a { text-decoration: underline; }
.info-card.has-link h3::after { content: "→"; margin-left: 8px; color: var(--b-ink); font-family: var(--f-body); }
.info-card p { margin: 0; color: var(--c-muted); }

.sec-quote { position: relative; max-width: 920px; margin: 0; padding-left: clamp(0px, 4vw, 48px); }
.sec-quote blockquote { margin: 0; padding: 0; border: 0; }
.sec-quote blockquote p { margin: 0; font: 700 clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem) / 1.3 var(--f-display); letter-spacing: -.01em; }
.sec-quote blockquote::before { content: "“"; display: block; height: .55em; font: 700 5rem / 1 var(--f-display); color: var(--b-fill); }
.sec-quote figcaption { margin-top: 18px; color: var(--c-muted); font-weight: 600; }
.sec-quote.has-img { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; align-items: start; }
.sec-quote__img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.entry-content .sec-quote blockquote { font-size: inherit; }

.faq { display: grid; gap: 12px; }
.faq__item { border: var(--bd-card); border-radius: var(--r-lg); background: #fff; padding: 0; transition: border-color var(--dur-1) var(--ease); }
.faq__item[open] { border-color: var(--b-fill); }
.faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 14px 22px; font-weight: 700; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary .icon { flex: none; width: 26px; height: 26px; transition: transform var(--dur-2) var(--ease); color: var(--b-ink); }
.faq__item[open] summary .icon { transform: rotate(180deg); }
.faq__answer { padding: 0 22px 20px; }
.faq__answer p { margin: 0; }
.entry-content .faq__item { padding: 0; }

/* Banner: photo with the text on a white card below/over its corner – never text on the photo itself */
.sec--banner { position: relative; padding: 0; margin-block: calc(var(--section-y) * .5); }
.sec--banner > .sec-banner__img, .sec--banner > .sec-banner__content { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.sec-banner__img img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-xl); }
.sec-banner__content { position: relative; z-index: 1; }
.sec-banner__content > * { max-width: 720px; }
.sec-banner__content h2 { margin: 0 0 12px; color: var(--c-text); }
.sec-banner__content .lead { color: var(--c-text); margin-bottom: 20px; }
.sec-banner__inner { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: clamp(20px, 3vw, 36px); }
@media (min-width: 900px) {
	.sec--banner .sec-banner__content { margin-top: -120px; }
	.sec--banner .sec-banner__content > .sec-banner__inner { margin-left: clamp(24px, 4vw, 56px); }
}
@media (max-width: 899px) { .sec--banner .sec-banner__content { margin-top: -24px; } .sec--banner .sec-banner__content > .sec-banner__inner { margin-inline: 12px; } }
.sec--banner.sec--inline > .sec-banner__img, .sec--banner.sec--inline > .sec-banner__content { padding-inline: 0; }
.sec-banner__inner .btn { margin-top: 4px; }

.sec--notice .alert { max-width: 880px; }
.sec--buttons .block-buttons { max-width: 880px; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 48px; margin: 0; padding: 0; list-style: none; }
.logo-row__img { max-height: 72px; width: auto; max-width: 180px; object-fit: contain; }
.sec .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.house-story { border-top: var(--bd-hair); }
.house-story > .sec:first-child:not(.sec--bg-hall):not(.sec--bg-toon):not(.sec--banner) { padding-top: var(--section-y); }

.price-houses { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-block: 40px; }
.price-house { position: relative; overflow: hidden; min-width: 0; padding: clamp(24px, 3vw, 36px) clamp(20px, 3vw, 32px) clamp(20px, 3vw, 32px); background: #fff; border: var(--bd-card); border-radius: var(--r-lg); }
.price-house::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--b-fill); }
.entry-content .price-house__title, .price-house__title { margin-top: 0; }
.price-house__title a { color: var(--c-text); text-decoration: none; }
.price-house__title a:hover { text-decoration: underline; }
.price-house__contact { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.price-house__contact a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.price-house .price-table { overflow-x: auto; }
.price-house__contact .icon { margin-top: .3em; color: var(--b-ink); }
.page-chips { margin: 8px 0 24px; }
.entry-content .price-house { max-width: 960px; }

.tvk-block-empty { padding: 28px; border: 2px dashed var(--c-line-strong); border-radius: var(--r-md); text-align: center; font-size: 1.125rem; }

@media (max-width: 599px) {
	.timeline__item { grid-template-columns: minmax(0, 1fr); padding-left: 34px; padding-bottom: 24px; }
	.timeline__item::before { left: 7px; top: 16px; }
	.timeline__item::after { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--b-fill); }
	.timeline__year { text-align: left; font-size: 1.25rem; }
	.timeline__body { padding-left: 0; }
	.timeline__body::before { display: none; }
	.sec-quote.has-img { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
	.sec-quote__img { width: 64px; height: 64px; }
}
@media (max-width: 400px) {
	.price-house { padding: 16px 14px; }
	.price-house .price-table :is(th, td) { padding: 10px 6px; }
	.price-house .price-table td:first-child { overflow-wrap: anywhere; }
}
/* Banner on phones: more of the photo shows above the card */
@media (max-width: 719px) {
	.sec-banner__img img { aspect-ratio: 4 / 3; }
	.sec--banner .sec-banner__content { margin-top: -40px; }
}
