/* ==========================================================================
   Eduzorro — visual identity
   Concept: a cross-border gazetteer. Every page starts by fixing two
   coordinates (region · language) and drills into a decision backed by
   reviews — so the language here is travel-document / index-ledger, not
   generic SaaS: kraft paper, a postmark "coordinate stamp", and a recurring
   ink-stamp rating badge as the one signature element.
   ========================================================================== */

:root {
    /* Color */
    --ink:        #1E2B27;
    --ink-soft:   #55645D;
    --ink-faint:  #8A9690;
    --paper:      #EFE6CF;
    --paper-deep: #E6DABE;
    --card:       #FBF7EC;
    --teal:       #1F5C52;
    --teal-deep:  #123A34;
    --teal-tint:  #E4EEEA;
    --brass:      #AD8536;
    --brass-deep: #7C5F26;
    --brick:      #9C4632;
    --brick-tint: #F3E3DE;
    --line:       #D9CBA0;
    --line-soft:  #E5DAB9;

    /* Type */
    --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Layout */
    --radius-card: 10px;
    --radius-sm: 6px;
    --shadow-card: 0 1px 2px rgba(30, 43, 39, .06), 0 6px 16px rgba(30, 43, 39, .05);
    --shadow-card-hover: 0 2px 4px rgba(30, 43, 39, .08), 0 12px 24px rgba(30, 43, 39, .09);
}

/* ---------- Reset & base ------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.75rem); font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }
ul { padding: 0; margin: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
    border-radius: 3px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lead { color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; }
.empty { color: var(--ink-faint); font-style: italic; padding: 24px 0; }

/* Eyebrow-style section headings: small caps + tracked, ledger-index feel */
.home-section h2 {
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--brass-deep);
    margin-bottom: 1rem;
}
.home-section { margin: 40px 0; }

/* ---------- Header / footer --------------------------------------------- */
.site-header {
    background: var(--teal-deep);
    color: var(--card);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 650;
    font-size: 1.35rem;
    color: var(--card) !important;
    letter-spacing: -.01em;
    text-decoration: none !important;
}
.brand-logo { height: 120px; width: auto; display: block; }


.switchers { display: flex; gap: 8px; }
.switcher select {
    padding: 7px 10px;
    border: 1.5px solid rgba(239, 230, 207, .35);
    border-radius: var(--radius-sm);
    background: var(--teal-deep);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: .8rem;
}

.site-footer {
    margin-top: 56px;
    padding: 28px 0;
    color: var(--ink-soft);
    border-top: 1px solid var(--line);
    background: var(--paper-deep);
    font-size: .9rem;
}

/* ---------- Alerts -------------------------------------------------------*/
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin: 20px 0; font-size: .95rem; }
.alert-success { background: var(--teal-tint); color: var(--teal-deep); border: 1px solid #BFDAD1; }
.alert-error { background: var(--brick-tint); color: var(--brick); border: 1px solid #E3BEB2; }
.alert-error ul { list-style: disc; padding-left: 1.2em; }
.alert-error li { list-style: disc; }

/* ---------- Hero ---------------------------------------------------------*/
.hero {
    padding: 56px 0 32px;
    position: relative;
}
.hero-compact { padding: 36px 0 20px; }
.hero h1 { margin-bottom: .3em; }

/* Perforation divider — the one place we spend this motif */
.hero::after {
    content: "";
    display: block;
    margin-top: 32px;
    height: 2px;
    background-image: repeating-linear-gradient(90deg, var(--line) 0 7px, transparent 7px 16px);
}
.hero-compact::after { margin-top: 20px; }

/* ---------- Region / language chooser (home) -----------------------------*/
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.region-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 18px 20px 16px;
    position: relative;
}
.region-card::before {
    content: "";
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 0;
    border-top: 2px dashed var(--line);
}
.region-card h3 {
    margin: 8px 0 12px;
    font-size: 1.05rem;
}
.lang-links { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-links li { list-style: none; }
.lang-links a {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 500;
    color: var(--teal-deep);
    background: var(--teal-tint);
    border-radius: 999px;
    padding: 4px 11px;
    text-decoration: none;
}
.lang-links a:hover { background: var(--teal); color: var(--card); }

.region-card-industries {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dotted var(--line);
}
.region-card-industries .mini-eyebrow {
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--brass-deep);
    margin: 0 0 8px;
}
.region-card-industries .chip-list { gap: 6px; }
.region-card-industries .chip { font-size: .8rem; padding: 4px 11px; }

.language-list { display: flex; flex-wrap: wrap; gap: 10px; }
.language-list li { list-style: none; }
.language-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--ink);
    text-decoration: none;
}
.language-list a:hover { border-color: var(--teal); color: var(--teal-deep); }
.language-list small { font-family: var(--font-mono); color: var(--ink-faint); }

/* ---------- Industries / categories (region-language, industry pages) ----*/
.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.industry-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 18px 20px;
}
.industry-block h3 { margin-bottom: 10px; }
.industry-block h3 a { color: var(--ink); }
.category-links { display: flex; flex-direction: column; gap: 6px; }
.category-links li { list-style: none; }
.category-links a { color: var(--teal); font-size: .95rem; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}
.category-tile {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}
.category-tile:hover { border-color: var(--teal); color: var(--teal-deep); background: var(--teal-tint); }

.page-head { margin: 24px 0 8px; }

/* ---------- Breadcrumbs (ledger trail) ------------------------------------*/
.breadcrumbs { margin: 20px 0 4px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
.breadcrumbs li {
    list-style: none;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs [aria-current] { color: var(--brass-deep); font-weight: 600; }

/* ---------- Quick search --------------------------------------------------*/
.quick-search { display: flex; gap: 10px; margin: 18px 0 8px; max-width: 560px; }
.quick-search-field { position: relative; flex: 1; }
.quick-search-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
}
.quick-search-field input:focus { border-color: var(--teal); outline: none; }
.quick-search button {
    background: var(--teal);
    color: var(--card);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}
.quick-search button:hover { background: var(--teal-deep); }
.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    z-index: 20;
    max-height: 320px;
    overflow-y: auto;
}
.suggestions li { list-style: none; padding: 9px 14px; cursor: pointer; font-size: .92rem; }
.suggestions li:hover, .suggestions li.active { background: var(--teal-tint); }

/* ---------- Listing toolbar / sort ----------------------------------------*/
.listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.result-count { color: var(--ink-soft); font-size: .92rem; }
.sort-form { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); }
.sort-form select {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: .82rem;
    color: var(--ink);
}

/* ---------- Company cards --------------------------------------------------*/
.company-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
}
.company-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.company-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.company-card-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.company-card-head h3 { margin: 0; flex: 1 1 auto; font-size: 1.05rem; }
.company-card-head h3 a { color: var(--ink); }
.company-card-desc { color: var(--ink-soft); font-size: .93rem; margin: 0; }
.company-card-address { color: var(--ink-faint); font-size: .85rem; margin: 0; font-family: var(--font-mono); }
.btn-link { color: var(--teal); font-weight: 600; font-size: .9rem; align-self: flex-start; }
.company-card-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 9px;
}
.badge-verified { background: var(--brass); color: var(--card); }
.badge-type { background: var(--teal-tint); color: var(--teal-deep); }

/* ---------- The rating stamp: signature element ---------------------------*/
.rating-stamp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.rating-stamp-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--brass);
    box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--brass-deep);
    background: var(--card);
    transform: rotate(-4deg);
    transition: transform .2s ease;
    flex-shrink: 0;
}
.company-card:hover .rating-stamp-ring,
.rating-stamp:hover .rating-stamp-ring { transform: rotate(0deg); }
.rating-stamp-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: .92rem;
    color: var(--brass-deep);
}
.rating-stamp-count {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--ink-faint);
}

/* Simple star row (individual reviews) */
.stars { display: inline-flex; align-items: center; gap: 2px; }
.star { font-size: .95rem; line-height: 1; }
.star.full, .star.half { color: var(--brass); }
.star.empty { color: var(--line); }
.rating-value { font-family: var(--font-mono); font-weight: 600; margin-left: 4px; }
.rating-count { font-family: var(--font-mono); color: var(--ink-faint); font-size: .85rem; }

/* ---------- Related / chips -------------------------------------------- */
.related { margin: 40px 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li { list-style: none; }
.chip {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .88rem;
    color: var(--teal-deep);
}
.chip:hover { background: var(--teal-tint); }
.chip-active { background: var(--teal) !important; color: var(--card) !important; }

/* Category select: progressive-enhancement dropdown wrapping real <a> links */
.category-select-control {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.category-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    min-width: 240px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}
.category-select-trigger:hover { border-color: var(--teal); }
.category-select-trigger[aria-expanded="true"] { border-color: var(--teal); }
.category-select-caret { color: var(--brass-deep); font-size: .75rem; }

.category-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    width: min(360px, 90vw);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card-hover);
    padding: 10px;
}
.category-select-search {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 8px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--ink);
}
.category-select-search:focus { outline: none; border-color: var(--teal); }

.category-select-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
}
.category-select-list li { list-style: none; }
.category-select-list .chip {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    background: transparent;
}
.category-select-list .chip:hover { background: var(--teal-tint); }
.category-select-list .chip-active { background: var(--teal-tint) !important; color: var(--teal-deep) !important; font-weight: 600; }

/* ---------- Pagination --------------------------------------------------- */
.pagination-wrap { margin: 28px 0; display: flex; justify-content: center; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card); color: var(--ink); font-weight: 600;
    font-family: var(--font-mono); font-size: .85rem;
}
.pagination .page.current { background: var(--teal); color: var(--card); border-color: var(--teal); }
.pagination .page.disabled, .pagination .page.dots { color: var(--ink-faint); background: transparent; cursor: default; }
.pagination a.page:hover { text-decoration: none; border-color: var(--teal); }

/* ---------- Company profile (the "dossier") ------------------------------*/
.company-profile { margin: 24px 0 60px; }
.company-header { margin-bottom: 24px; }
.company-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

.company-section {
    margin: 32px 0;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}
.company-section:first-of-type { border-top: none; padding-top: 0; }
.prose { color: var(--ink); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { list-style: inherit; margin-bottom: .35em; }
.prose h2, .prose h3 { margin-top: 1.2em; }
.prose blockquote {
    margin: 1em 0;
    padding: 8px 16px;
    border-left: 3px solid var(--brass);
    background: var(--paper-deep);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose a { text-decoration: underline; }

.company-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
@media (max-width: 760px) {
    .company-columns { grid-template-columns: 1fr; }
}

.contact-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.contact-list li {
    list-style: none;
    padding-bottom: 9px;
    border-bottom: 1px dotted var(--line);
    font-size: .96rem;
}
.available-in { font-size: .88rem; color: var(--ink-soft); font-family: var(--font-mono); }

.map {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    overflow: hidden;
    position: relative;
}
/* subtle "postcard corner" nod without overdoing skeuomorphism */
.map::after {
    content: "";
    position: absolute;
    top: -8px; right: 14px;
    width: 26px; height: 40px;
    background: rgba(173, 133, 54, .55);
    transform: rotate(8deg);
    pointer-events: none;
    z-index: 500;
}

.btn {
    display: inline-block;
    background: var(--teal);
    color: var(--card) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
}
.btn:hover { background: var(--teal-deep); }
.btn-primary { background: var(--teal); }

/* ---------- Reviews (ledger entries) --------------------------------------*/
.review {
    padding: 18px 0;
    border-bottom: 1px dotted var(--line);
}
.review:first-child { padding-top: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-author { font-weight: 600; }
.review-head time { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-faint); }
.review-title { margin: 4px 0 6px; font-size: 1rem; }

/* ---------- Review form (declaration form) --------------------------------*/
.review-form { max-width: 640px; display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.review-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
}
.review-form input, .review-form select, .review-form textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink);
    background: var(--card);
    border: none;
    border-bottom: 1.5px solid var(--line);
    padding: 8px 2px;
}
.review-form input:focus, .review-form select:focus, .review-form textarea:focus {
    outline: none;
    border-bottom-color: var(--teal);
}
.review-form textarea { resize: vertical; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.rating-field select { max-width: 140px; }

/* ---------- Responsive ---------------------------------------------------*/
@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .quick-search { flex-direction: column; }
    .quick-search button { padding: 12px; }
}

/* ---------- Motion preferences -------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    .company-card, .rating-stamp-ring { transition: none !important; }
    .rating-stamp-ring { transform: none !important; }
    .company-card:hover { transform: none !important; }
}

/* Honeypot field: visually removed, still in the DOM for bots to trip on */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
