/*
 * Etched Folio: components
 * Needs tokens.css first. Every class starts with "ef-" so it can sit next to any other CSS.
 */

/* Base */
.ef { margin: 0; background: var(--ef-paper); color: var(--ef-ink); font-family: var(--ef-serif); font-size: var(--ef-text-body); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
.ef *, .ef *::before, .ef *::after { box-sizing: border-box; }
.ef img, .ef svg { max-width: 100%; display: block; }
.ef a { color: inherit; }
.ef-container { width: min(100% - 40px, var(--ef-container)); margin-inline: auto; }
.ef-measure { width: min(100% - 40px, var(--ef-measure)); margin-inline: auto; }
.ef-center { text-align: center; }
.ef-center .ef-lead { margin-inline: auto; }

/* Type: Cormorant for display, Alegreya for reading, Alegreya SC for labels */
.ef-hero-title, .ef-h2, .ef-h3 { margin: 0; font-family: var(--ef-display); font-weight: 600; line-height: 1.06; color: inherit; }
.ef-hero-title { font-size: var(--ef-text-hero); letter-spacing: -0.01em; }
.ef-h2 { font-size: var(--ef-text-h2); }
.ef-h3 { font-size: var(--ef-text-h3); line-height: 1.2; }
.ef-hero-title em, .ef-h2 em, .ef-h3 em { font-style: italic; font-weight: 500; }
.ef-caps { font-family: var(--ef-caps); font-weight: 500; font-size: var(--ef-text-caps); letter-spacing: var(--ef-tracking-caps); }
.ef-kicker { display: inline-block; margin-bottom: var(--ef-space-2); color: var(--ef-rust); font-family: var(--ef-caps); font-weight: 700; font-size: var(--ef-text-caps); letter-spacing: var(--ef-tracking-caps); }
.ef-lead { max-width: 620px; margin: var(--ef-space-3) 0 0; color: var(--ef-soft); font-size: var(--ef-text-lead); line-height: 1.5; }
.ef-link { color: var(--ef-harbor); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ef-link:hover { color: var(--ef-rust); }

/* Masthead: centered title, italic flourish word, a ruled nav band underneath */
.ef-masthead { padding-top: var(--ef-space-4); }
.ef-masthead__top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--ef-space-2); }
.ef-masthead__title { margin: 0; font-family: var(--ef-display); font-weight: 500; font-size: var(--ef-text-masthead); line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; text-align: center; white-space: nowrap; }
.ef-masthead__title em { text-transform: none; font-style: italic; font-weight: 500; letter-spacing: 0; }
.ef-masthead__title a { text-decoration: none; }
.ef-masthead__end { justify-self: end; }
.ef-masthead__motto { margin: var(--ef-space-1) 0 0; text-align: center; color: var(--ef-soft); font-style: italic; font-size: var(--ef-text-small); }
.ef-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--ef-space-3); margin-top: var(--ef-space-3); padding-block: 12px; border-top: var(--ef-border); border-bottom: var(--ef-border); }
.ef-nav__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; font-size: 17px; }
.ef-nav__links a { text-decoration: none; }
.ef-nav__links a:hover, .ef-nav__links a[aria-current] { color: var(--ef-harbor); text-decoration: underline; text-underline-offset: 6px; }
.ef-icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: var(--ef-border-ink); border-radius: 50%; color: var(--ef-ink); background: transparent; }
.ef-icon-btn svg { width: 18px; height: 18px; }

/* Buttons: harbor pills, ruled square outline for secondary */
.ef-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border: 0; border-radius: var(--ef-radius-pill); background: var(--ef-harbor); color: var(--ef-paper); font-family: var(--ef-serif); font-size: 17px; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; }
.ef-a .ef-btn, a.ef-btn { color: var(--ef-paper); }
.ef-btn:hover { background: var(--ef-harbor-deep); }
.ef-btn--outline { border: var(--ef-border-ink); border-radius: var(--ef-radius); background: transparent; color: var(--ef-ink); font-family: var(--ef-caps); font-size: var(--ef-text-caps); letter-spacing: var(--ef-tracking-caps); padding: 9px 20px; }
a.ef-btn--outline { color: var(--ef-ink); }
.ef-btn--outline:hover { background: var(--ef-ink); color: var(--ef-paper); }
.ef-btn--block { width: 100%; }

/* Notice band: mist panel between two ochre rules, engraved fans either side */
.ef-notice { border-top: var(--ef-ochre-rule); border-bottom: var(--ef-ochre-rule); background: var(--ef-mist); padding-block: var(--ef-space-3); }
.ef-notice__inner { display: grid; grid-template-columns: 120px 1fr 120px; align-items: center; gap: var(--ef-space-3); text-align: center; }
.ef-notice__title { margin: 0; font-family: var(--ef-caps); font-weight: 700; font-size: clamp(19px, 2.2vw, 26px); letter-spacing: 0.02em; }
.ef-notice__sub { margin: 4px 0 var(--ef-space-2); font-family: var(--ef-caps); font-size: 17px; }
.ef-notice__art { color: var(--ef-ink); }

/* Sections */
.ef-section { padding-block: var(--ef-section); }
.ef-section--vellum { background: var(--ef-vellum); border-top: var(--ef-border); border-bottom: var(--ef-border); }
.ef-section--harbor { background: var(--ef-harbor-deep); color: var(--ef-paper); }
.ef-section--harbor .ef-lead { color: rgba(251, 250, 245, 0.78); }
.ef-section--harbor .ef-kicker { color: var(--ef-ochre); }
.ef-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ef-space-3); padding-bottom: var(--ef-space-2); margin-bottom: var(--ef-space-4); border-bottom: var(--ef-border-ink); }
.ef-fleuron { display: flex; align-items: center; gap: var(--ef-space-2); color: var(--ef-ochre); margin-block: var(--ef-space-4); }
.ef-fleuron::before, .ef-fleuron::after { content: ""; flex: 1; height: 1px; background: var(--ef-rule); }

/* Three-column folio: framed aside, plate, ruled aside */
.ef-folio { display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; gap: var(--ef-space-4); align-items: start; }
.ef-aside { padding: var(--ef-space-2) var(--ef-space-3); border: var(--ef-border); border-top: var(--ef-frame); border-left: var(--ef-frame); background: var(--ef-paper); font-size: var(--ef-text-small); line-height: 1.55; }
.ef-aside--plain { border: var(--ef-border); text-align: center; }
.ef-aside p { margin: 0 0 var(--ef-space-2); }
.ef-quote { margin: var(--ef-space-3) 0 0; font-family: var(--ef-display); font-style: italic; font-size: 22px; line-height: 1.3; text-align: center; }
.ef-quote cite { display: block; margin-top: 6px; font-family: var(--ef-caps); font-style: normal; font-size: 13px; letter-spacing: var(--ef-tracking-caps); color: var(--ef-soft); }

/* Plate: an engraved illustration in a thin frame with a "Fig." caption */
.ef-plate { margin: 0; }
.ef-plate__frame { padding: 10px; border: var(--ef-border); background: var(--ef-vellum); box-shadow: var(--ef-shadow-plate); }
.ef-plate__frame svg { width: 100%; height: auto; color: var(--ef-ink); background: var(--ef-paper); }
.ef-plate figcaption { margin-top: 10px; color: var(--ef-soft); font-size: var(--ef-text-small); font-style: italic; }
.ef-plate figcaption b { font-family: var(--ef-caps); font-style: normal; font-weight: 700; color: var(--ef-ink); letter-spacing: var(--ef-tracking-caps); }

/* Entries: essay or collection cards, ruled not boxed */
.ef-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ef-space-4) var(--ef-space-4); }
.ef-entry { display: flex; flex-direction: column; gap: 10px; padding-top: var(--ef-space-2); border-top: var(--ef-border-ink); text-decoration: none; }
.ef-entry__art { aspect-ratio: 4 / 3; padding: 8px; border: var(--ef-border); background: var(--ef-vellum); }
.ef-entry__art svg { width: 100%; height: 100%; background: var(--ef-paper); color: var(--ef-ink); }
.ef-entry__title { margin: 0; font-family: var(--ef-display); font-weight: 600; font-size: 26px; line-height: 1.15; }
.ef-entry__title:hover { color: var(--ef-harbor); }
.ef-entry__meta { color: var(--ef-soft); font-size: var(--ef-text-small); font-style: italic; }
.ef-entry p { margin: 0; font-size: 17px; }

/* Badges */
.ef-badge { display: inline-block; align-self: flex-start; padding: 2px 10px; border: 1px solid currentColor; border-radius: var(--ef-radius-pill); color: var(--ef-harbor); font-family: var(--ef-caps); font-size: 13px; font-weight: 500; letter-spacing: var(--ef-tracking-caps); white-space: nowrap; }
.ef-badge--ochre { color: var(--ef-rust); background: rgba(195, 154, 46, 0.14); border-color: var(--ef-ochre); }

/* Forms */
.ef-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--ef-space-2); }
.ef-label { font-family: var(--ef-caps); font-size: var(--ef-text-caps); font-weight: 500; letter-spacing: var(--ef-tracking-caps); }
.ef-input, .ef-select { width: 100%; padding: 10px 12px; border: var(--ef-border); border-bottom: var(--ef-border-ink); border-radius: var(--ef-radius); background: var(--ef-paper); color: var(--ef-ink); font-family: var(--ef-serif); font-size: 17px; }
.ef-input:focus, .ef-select:focus { outline: 2px solid var(--ef-harbor); outline-offset: 1px; }
.ef-hint { color: var(--ef-soft); font-size: 14px; font-style: italic; }
.ef-check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--ef-text-small); }
.ef-check input { margin-top: 5px; accent-color: var(--ef-harbor); }

/* Pricing: ruled ledger columns, the featured one framed in harbor */
.ef-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: var(--ef-border-ink); background: var(--ef-paper); }
.ef-plan { display: flex; flex-direction: column; gap: var(--ef-space-2); padding: var(--ef-space-4) var(--ef-space-3); border-right: var(--ef-border); }
.ef-plan:last-child { border-right: 0; }
.ef-plan--featured { outline: var(--ef-frame); outline-offset: -2px; background: var(--ef-mist); }
.ef-plan__name { margin: 0; font-family: var(--ef-caps); font-weight: 700; font-size: 20px; letter-spacing: var(--ef-tracking-caps); }
.ef-plan__price { font-family: var(--ef-display); font-weight: 600; font-size: 54px; line-height: 1; }
.ef-plan__price small { font-family: var(--ef-serif); font-size: 16px; font-weight: 400; font-style: italic; color: var(--ef-soft); }
.ef-plan ul { margin: 0; padding: 0; list-style: none; font-size: 17px; }
.ef-plan li { padding: 8px 0 8px 22px; border-bottom: 1px dotted var(--ef-rule); position: relative; }
.ef-plan li::before { content: "\2766"; position: absolute; left: 0; top: 8px; color: var(--ef-ochre); font-size: 14px; }
.ef-plan .ef-btn { margin-top: auto; }

/* FAQ */
.ef-faq details { border-bottom: var(--ef-border); padding-block: var(--ef-space-2); }
.ef-faq summary { cursor: pointer; font-family: var(--ef-display); font-weight: 600; font-size: 22px; list-style: none; }
.ef-faq summary::-webkit-details-marker { display: none; }
.ef-faq summary::after { content: "+"; float: right; color: var(--ef-harbor); }
.ef-faq details[open] summary::after { content: "\2212"; }
.ef-faq p { margin: 10px 0 0; color: var(--ef-soft); }

/* Article */
.ef-article { font-size: 19px; line-height: 1.7; }
.ef-article > p:first-of-type::first-letter { float: left; margin: 6px 10px 0 0; font-family: var(--ef-display); font-weight: 600; font-size: 78px; line-height: 0.8; color: var(--ef-harbor); }
.ef-article h2 { margin: var(--ef-space-4) 0 var(--ef-space-2); font-family: var(--ef-display); font-weight: 600; font-size: 32px; line-height: 1.15; }
.ef-article blockquote { margin: var(--ef-space-4) 0; padding: var(--ef-space-2) var(--ef-space-3); border-left: var(--ef-frame); font-family: var(--ef-display); font-style: italic; font-size: 26px; line-height: 1.35; }
.ef-article .ef-plate { margin-block: var(--ef-space-4); }
.ef-byline { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: var(--ef-space-3); color: var(--ef-soft); font-size: var(--ef-text-small); font-style: italic; }
.ef-footnotes { margin-top: var(--ef-space-4); padding-top: var(--ef-space-2); border-top: var(--ef-border); color: var(--ef-soft); font-size: 15px; }

/* Footer */
.ef-footer { margin-top: var(--ef-space-5); padding-block: var(--ef-space-5) var(--ef-space-4); border-top: var(--ef-border-ink); font-size: var(--ef-text-small); }
.ef-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--ef-space-4); }
.ef-footer h4 { margin: 0 0 10px; font-family: var(--ef-caps); font-weight: 700; font-size: var(--ef-text-caps); letter-spacing: var(--ef-tracking-caps); }
.ef-footer ul { margin: 0; padding: 0; list-style: none; line-height: 2; }
.ef-footer a { text-decoration: none; }
.ef-footer a:hover { color: var(--ef-harbor); text-decoration: underline; }
.ef-footer__base { margin-top: var(--ef-space-4); padding-top: var(--ef-space-2); border-top: var(--ef-border); color: var(--ef-soft); font-style: italic; text-align: center; }

/* Responsive */
@media (max-width: 1080px) {
  .ef-folio { grid-template-columns: minmax(0, 1fr) 240px; }
  .ef-folio > .ef-aside:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .ef-folio, .ef-grid, .ef-plans { grid-template-columns: minmax(0, 1fr); }
  .ef-plan { border-right: 0; border-bottom: var(--ef-border); }
  .ef-plan:last-child { border-bottom: 0; }
  .ef-notice__inner { grid-template-columns: minmax(0, 1fr); }
  .ef .ef-notice__art { display: none; }
  .ef-footer__grid { grid-template-columns: 1fr 1fr; }
  .ef-nav { flex-direction: column; gap: 10px; }
  .ef-nav__links { gap: 4px 18px; font-size: 16px; }
  .ef-section-head { flex-direction: column; gap: 6px; }
}
@media (max-width: 560px) {
  .ef-masthead__top { grid-template-columns: auto 1fr auto; }
  .ef-masthead__title { font-size: clamp(22px, 7vw, 34px); letter-spacing: 0.01em; white-space: normal; line-height: 1.05; }
  .ef-icon-btn { width: 32px; height: 32px; }
  .ef-article > p:first-of-type::first-letter { font-size: 60px; }
}

/* Engraving helpers: hatch patterns live in a hidden <svg class="ef-defs"> on each page */
.ef-defs { position: absolute; width: 0; height: 0; overflow: hidden; color: var(--ef-ink); }
.ef-fill-paper { fill: var(--ef-paper); }
