/* ============================================================
   Everything Algarve — Main Stylesheet
   ============================================================ */

/* RESET & ROOT */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ocean:       #1B6CA8;
    --ocean-dark:  #0D2137;
    --ocean-mid:   #155d91;
    --ocean-light: #E8F4FD;
    --sand:        #E8A020;
    --sand-light:  #FDF6E8;
    --sea:         #2A9D8F;
    --sea-light:   #E8F7F5;
    --terra:       #C1440E;
    --terra-light: #FDF0EB;
    --white:       #FFFFFF;
    --off-white:   #F7F8FA;
    --border:      #E5E9EF;
    --text:        #1A2332;
    --text-2:      #4A5568;
    --text-3:      #8A9BB0;
    --radius:      12px;
    --radius-sm:   8px;
    --radius-pill: 20px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--off-white);
    color: var(--text);
    line-height: 1.6;
}

/* Holding page needs dark background full height */
body.holding {
    background: var(--ocean-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   HEADER — standard (listing / entity pages)
   ============================================================ */

.site-header {
    background: var(--ocean-dark);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: 5px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.header-main {
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* HEADER — holding page variant */
.holding-header {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* LOGO */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo:hover { text-decoration: none; }

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--ocean);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

/* Holding page logo is slightly larger */
.holding-header .logo-icon {
    width: 38px;
    height: 38px;
}

.logo-sun {
    width: 13px;
    height: 13px;
    background: var(--sand);
    border-radius: 50%;
}

.logo-wave {
    width: 18px;
    height: 4px;
    background: rgba(255,255,255,0.55);
    border-radius: 2px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-eyebrow {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sand);
    font-weight: 600;
}

.logo-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

/* NAV */
.main-nav { display: flex; gap: 2px; }

.nav-link {
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

/* HEADER SEARCH */
.header-search {
    padding: 7px 14px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: #fff;
    background: rgba(255,255,255,0.06);
    width: 180px;
}
.header-search::placeholder { color: rgba(255,255,255,0.35); }

/* LANGUAGE SWITCHER */
.lang-switcher { display: flex; gap: 4px; }

.lang-btn {
    padding: 3px 8px;
    font-size: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-pill);
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s;
}
.lang-btn:hover, .lang-btn.active {
    border-color: rgba(255,255,255,0.35);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 10px;
}
.breadcrumb a { color: rgba(255,255,255,0.5); }
.breadcrumb a:hover { color: rgba(255,255,255,0.8); text-decoration: none; }
.breadcrumb span { margin: 0 6px; opacity: 0.4; }

/* ============================================================
   TYPE BADGES
   ============================================================ */

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-city         { background: rgba(27,108,168,0.85);  color: #fff; }
.badge-town         { background: rgba(42,157,143,0.85);  color: #fff; }
.badge-village      { background: rgba(232,160,32,0.75);  color: #fff; }
.badge-beach        { background: rgba(13,33,55,0.7);     color: #fff; }
.badge-guide        { background: rgba(193,68,14,0.8);    color: #fff; }
.badge-municipality { background: rgba(139,100,180,0.8);  color: #fff; }

/* Hero variant (larger, outlined) */
.type-badge-hero { padding: 3px 10px; margin-bottom: 8px; }
.badge-hero-city    { background: rgba(27,108,168,0.4);  color: #7ec8f0; border: 1px solid rgba(27,108,168,0.4); }
.badge-hero-town    { background: rgba(42,157,143,0.3);  color: #7ed4c8; border: 1px solid rgba(42,157,143,0.3); }
.badge-hero-beach   { background: rgba(232,160,32,0.2);  color: #f0c85a; border: 1px solid rgba(232,160,32,0.3); }
.badge-hero-village { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.12); }
.badge-hero-guide   { background: rgba(193,68,14,0.25);  color: #f0926a; border: 1px solid rgba(193,68,14,0.3); }

/* ============================================================
   CARDS (shared)
   ============================================================ */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    text-decoration: none;
    display: block;
    color: var(--text);
}
.card:hover {
    border-color: var(--ocean);
    box-shadow: 0 4px 16px rgba(27,108,168,0.1);
    text-decoration: none;
}

.card-img {
    height: 120px;
    background: var(--ocean-light);
    position: relative;
    overflow: hidden;
}

.card-img-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-no-img { font-size: 28px; opacity: 0.15; }
.card-img .type-badge { position: absolute; top: 8px; left: 8px; }
.card-body    { padding: 12px 14px; }
.card-title   { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.card-meta    { font-size: 12px; color: var(--text-3); }
.card-summary {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   FILTER BAR (listing pages)
   ============================================================ */

.filter-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}

.filter-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 4px;
}

.f-chip {
    padding: 5px 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-2);
    background: var(--white);
    font-weight: 500;
    text-decoration: none;
}
.f-chip:hover  { border-color: var(--ocean); color: var(--ocean); text-decoration: none; }
.f-chip.active { background: var(--ocean); border-color: var(--ocean); color: #fff; }

/* ============================================================
   LISTING PAGE HERO
   ============================================================ */

.listing-hero {
    background: var(--ocean-dark);
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.listing-hero-inner { max-width: 1100px; margin: 0 auto; }
.listing-title { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -0.02em; margin-bottom: 6px; }
.listing-desc  { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.listing-meta  { font-size: 12px; color: rgba(255,255,255,0.35); }
.listing-meta strong { color: rgba(255,255,255,0.6); }

/* ============================================================
   LISTING GRID
   ============================================================ */

.listing-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state { text-align: center; padding: 60px 24px; color: var(--text-3); }
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-desc  { font-size: 14px; line-height: 1.6; }

/* ============================================================
   ENTITY PAGE HERO
   ============================================================ */

.page-hero {
    background: var(--ocean-dark);
    padding: 28px 24px 0;
}

.page-hero-inner { max-width: 1100px; margin: 0 auto; }

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.page-title    { font-size: 30px; font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 8px; }
.page-subtitle { font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.page-summary  { font-size: 14px; color: rgba(255,255,255,0.7); max-width: 620px; line-height: 1.65; }

.hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-hero {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.btn-save  { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.btn-share { background: var(--sand); color: var(--ocean-dark); }

.auto-translated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   PAGE TABS
   ============================================================ */

.page-tabs {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0 0 0 0;
    margin-left: -24px;
    margin-right: -24px;
    padding: 0 24px;
}
.page-tabs::-webkit-scrollbar { display: none; }

.page-tab {
    padding: 12px 18px;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.page-tab:hover  { color: rgba(255,255,255,0.9); text-decoration: none; }
.page-tab.active { color: #fff; border-bottom-color: var(--sand); }

/* ============================================================
   SECTION IMAGES & INLINE GALLERY
   ============================================================ */

/* Single image floats right inside the text — text wraps around it */
.section-img {
    float: right;
    margin: 4px 0 12px 16px;
    width: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.section-img img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: opacity 0.15s;
}
.section-img img:hover { opacity: 0.88; }

.section-img-credit {
    font-size: 9px;
    color: var(--text-3);
    text-align: right;
    margin-top: 3px;
    padding-right: 2px;
}

/* Clearfix on section-body so it wraps the float */
.section-body::after {
    content: "";
    display: table;
    clear: both;
}

/* Multi-image inline gallery — sits below the text */
.section-gallery {
    clear: both;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    margin-top: 14px;
}

.section-gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.section-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.section-gallery-item:hover img { transform: scale(1.04); }

.section-gallery-credit {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 8px;
    padding: 2px 5px;
}

@media (max-width: 600px) {
    .section-img {
        float: none;
        width: 100%;
        margin: 0 0 12px 0;
    }
}

.page-body {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    padding: 20px 24px;
}

/* TAB CONTENT */
.tab-content        { display: none; }
.tab-content.active { display: block; }

/* CONTENT SECTIONS */
.content-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.section-body { font-size: 14px; color: var(--text-2); line-height: 1.8; }
.section-body p { margin-bottom: 12px; }
.section-body p:last-child { margin-bottom: 0; }

/* HIGHLIGHTS */
.highlights { display: flex; flex-direction: column; gap: 8px; }

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ocean-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--ocean);
}

.hi-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ocean);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.hi-text { font-size: 13px; color: var(--text-2); line-height: 1.55; }

/* FAQS */
.faq-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.faq-a { font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar { display: flex; flex-direction: column; gap: 12px; }

.side-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.side-img {
    height: 140px;
    background: linear-gradient(160deg, var(--ocean), var(--sea));
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

.side-img-label { font-size: 11px; color: rgba(255,255,255,0.7); font-weight: 500; }

.side-img-btn {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}

.side-body { padding: 14px; }

.side-section { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.side-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.side-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.fact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.fact-row:last-child { border-bottom: none; }
.fact-label { color: var(--text-3); }
.fact-val   { font-weight: 600; color: var(--text); text-align: right; }

.lang-row { display: flex; gap: 5px; flex-wrap: wrap; }

.lang-pill {
    padding: 4px 12px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-2);
    font-weight: 500;
    text-decoration: none;
}
.lang-pill:hover  { border-color: var(--ocean); color: var(--ocean); text-decoration: none; }
.lang-pill.active { background: var(--ocean); border-color: var(--ocean); color: #fff; }

.nearby-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.nearby-item:last-child { border-bottom: none; }

.nearby-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--ocean-light);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nearby-name { flex: 1; font-weight: 500; color: var(--text); }
.nearby-dist { font-size: 11px; font-weight: 600; color: var(--ocean); }

/* ============================================================
   HOLDING PAGE
   ============================================================ */

/* Pulse animation (used by holding page badge + icon) */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.holding-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(27,108,168,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(232,160,32,0.12);
    border: 1px solid rgba(232,160,32,0.25);
    border-radius: 24px;
    font-size: 12px;
    color: var(--sand);
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.04em;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sand);
    animation: pulse 2s infinite;
}

.holding-hero h1 {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}
.holding-hero h1 span { color: var(--sand); }

.hero-sub {
    font-size: 16px;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    margin-bottom: 40px;
}

.coming-soon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
}

.coming-soon-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sea);
    animation: pulse 2s infinite;
}

/* Category icons grid (holding page) */
.cats {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 48px;
}

.cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    min-width: 80px;
}

.cat-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-icon-town   { background: rgba(27,108,168,0.4); }
.cat-icon-beach  { background: rgba(42,157,143,0.4); }
.cat-icon-village{ background: rgba(232,160,32,0.3); }
.cat-icon-guide  { background: rgba(193,68,14,0.3); }
.cat-icon-biz    { background: rgba(255,255,255,0.1); }
.cat-icon-prop   { background: rgba(42,157,143,0.25); }

.cat-label { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: var(--ocean-dark);
    margin-top: 40px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Holding page footer — no margin-top needed (flex layout pushes it down) */
.holding .site-footer { margin-top: 0; }

.footer-text { font-size: 12px; color: rgba(255,255,255,0.25); }

.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: rgba(255,255,255,0.25); text-decoration: none; }
.footer-links a:hover { color: rgba(255,255,255,0.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .main-nav      { display: none; }
    .header-right  { display: none; }
    .page-body     { grid-template-columns: 1fr; padding: 12px 16px; }
    .sidebar       { order: 2; } /* show below main content instead of hiding */
    .page-content  { order: 1; }
    .page-title    { font-size: 22px; }
    .listing-title { font-size: 20px; }
    .card-grid     { grid-template-columns: repeat(2, 1fr); }
    .holding-hero h1 { font-size: 32px; }
    .cats          { gap: 6px; }
    .cat           { min-width: 64px; padding: 10px 12px; }
    .holding-header{ padding: 16px 20px; }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .header-top { display: none; }
}
