/*
 * KnowThePerch — Homepage v3
 * Implements homepage-v3.jsx as visual authority.
 * Loaded only on the front page; all classes prefixed ktp-v3-.
 */

/* ─── Shell ─────────────────────────────────────────────────────────── */
.ktp-v3-main {
    background: var(--ktp-sand);
}

.ktp-v3-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Hero ──────────────────────────────────────────────────────────── */
.ktp-v3-hero {
    background: var(--ktp-parchment);
    border-bottom: 1px solid var(--ktp-sand);
    padding: 72px 24px 64px;
    text-align: center;
}

.ktp-v3-hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

.ktp-v3-kicker {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--ktp-canopy);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 16px;
    display: block;
}

.ktp-v3-hero h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--ktp-forest);
    margin: 0 0 16px;
    line-height: 1.1;
}

.ktp-v3-hero-deck {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 16px;
    color: var(--ktp-bark);
    margin: 0 0 32px;
    line-height: 1.65;
}

/* ─── Hero search ───────────────────────────────────────────────────── */
.ktp-v3-search-wrap {
    max-width: 520px;
    margin: 0 auto;
}

.ktp-v3-search-wrap form {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--ktp-sand);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(45,74,62,0.07);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ktp-v3-search-wrap form:focus-within {
    border-color: rgba(74,124,92,0.5);
    box-shadow: 0 4px 20px rgba(45,74,62,0.11);
}

.ktp-v3-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--ktp-stone);
    flex-shrink: 0;
}

.ktp-v3-search-wrap input[type="search"] {
    flex: 1;
    padding: 15px 12px 15px 46px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: 'Alegreya Sans', sans-serif;
    color: var(--ktp-ink);
    outline: none;
    -webkit-appearance: none;
    min-width: 0;
}

.ktp-v3-search-wrap input[type="search"]::placeholder {
    color: var(--ktp-stone);
}

.ktp-v3-search-btn {
    background: var(--ktp-forest);
    color: #fff;
    border: none;
    padding: 15px 24px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.ktp-v3-search-btn:hover {
    background: var(--ktp-canopy);
}

/* ─── Stats bar (pillars) ───────────────────────────────────────────── */
.ktp-v3-pillars-grid {
    background: var(--ktp-forest);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.ktp-v3-pillar-stat {
    padding: 20px 48px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.ktp-v3-pillar-stat:last-child {
    border-right: none;
}

.ktp-v3-pillar-value {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.ktp-v3-pillar-label {
    display: block;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 11px;
    color: rgba(212,232,218,0.75);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ─── Section spacing ───────────────────────────────────────────────── */
.ktp-v3-section {
    padding-top: 48px;
}

.ktp-v3-section-center {
    text-align: center;
    margin-bottom: 28px;
}

.ktp-v3-eyebrow {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--ktp-canopy);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0 0 6px;
    display: block;
}

.ktp-v3-section h2,
.ktp-v3-section-center h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--ktp-forest);
    margin: 0;
    line-height: 1.25;
}

.ktp-v3-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.ktp-v3-row-header h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--ktp-forest);
    margin: 0;
}

.ktp-v3-more-link {
    font-size: 12px;
    color: var(--ktp-canopy);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Alegreya Sans', sans-serif;
    white-space: nowrap;
}

.ktp-v3-more-link:hover {
    text-decoration: underline;
}

/* ─── Tool / silo cards (3-up) ──────────────────────────────────────── */
.ktp-v3-silo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ktp-v3-silo-card {
    background: var(--ktp-parchment);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--ktp-sand);
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.2s;
}

.ktp-v3-silo-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: rgba(74,124,92,0.35);
}

.ktp-v3-silo-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ktp-v3-silo-head img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.ktp-v3-silo-head h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--ktp-forest);
    margin: 0;
    line-height: 1.2;
}

.ktp-v3-silo-card > p {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 14px;
    color: var(--ktp-bark);
    line-height: 1.6;
    margin: 0 0 16px;
}

.ktp-v3-silo-count {
    font-size: 12px;
    color: var(--ktp-canopy);
    font-weight: 600;
    font-family: 'Alegreya Sans', sans-serif;
}

/* ─── Trending photo cards (featured-card wrapper) ──────────────────── */
.ktp-v3-featured-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ktp-v3-trending-item {
    background: var(--ktp-parchment);
    border-radius: 12px;
    border: 1px solid var(--ktp-sand);
    overflow: hidden;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.25s;
}

.ktp-v3-trending-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}

.ktp-v3-trending-photo {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: rgba(74,124,92,0.08);
}

.ktp-v3-trending-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    transition: transform 0.4s ease;
}

.ktp-v3-trending-item:hover .ktp-v3-trending-photo img {
    transform: scale(1.04);
}

.ktp-v3-trending-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ktp-v3-trending-body {
    padding: 16px 18px 20px;
}

.ktp-v3-trending-body h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--ktp-forest);
    line-height: 1.3;
    margin: 0 0 8px;
}

.ktp-v3-trending-body p {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 13px;
    color: var(--ktp-bark);
    line-height: 1.55;
    margin: 0;
}

/* ─── Guide category cards (stories-grid) ───────────────────────────── */
.ktp-v3-stories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ktp-v3-story-card {
    background: var(--ktp-parchment);
    border-radius: 10px;
    border: 1px solid var(--ktp-sand);
    overflow: hidden;
    text-decoration: none;
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s, transform 0.2s;
}

.ktp-v3-story-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}

.ktp-v3-story-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ktp-v3-story-body {
    padding: 14px 16px 18px;
}

.ktp-v3-story-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ktp-forest);
    font-family: 'Cormorant Garamond', Georgia, serif;
    line-height: 1.3;
    margin: 0 0 6px;
}

.ktp-v3-story-body p {
    font-size: 12px;
    color: var(--ktp-bark);
    font-family: 'Alegreya Sans', sans-serif;
    line-height: 1.55;
    margin: 0;
}

/* ─── Popular species list ──────────────────────────────────────────── */
.ktp-v3-species-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ktp-v3-species-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: var(--ktp-parchment);
    border-radius: 8px;
    border: 1px solid var(--ktp-sand);
    text-decoration: none;
    align-items: center;
    transition: border-color 0.15s;
}

.ktp-v3-species-item:hover {
    border-color: rgba(74,124,92,0.4);
}

.ktp-v3-species-item img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    opacity: 0.7;
    flex-shrink: 0;
}

.ktp-v3-species-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--ktp-forest);
    font-family: 'Cormorant Garamond', Georgia, serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ktp-v3-species-arrow {
    color: rgba(139,134,120,0.5);
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

/* ─── Browse by state ───────────────────────────────────────────────── */
.ktp-v3-state-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ktp-v3-state-card {
    padding: 14px 16px;
    background: var(--ktp-parchment);
    border-radius: 8px;
    border: 1px solid var(--ktp-sand);
    text-decoration: none;
    display: block;
    transition: border-color 0.15s;
}

.ktp-v3-state-card:hover {
    border-color: rgba(74,124,92,0.4);
}

.ktp-v3-state-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--ktp-forest);
    display: block;
}

.ktp-v3-state-count {
    font-size: 12px;
    color: var(--ktp-canopy);
    font-family: 'Alegreya Sans', sans-serif;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

/* ─── Data sources section ──────────────────────────────────────────── */
.ktp-v3-sources-section {
    padding-bottom: 56px;
}

.ktp-v3-sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.ktp-v3-source-card {
    background: var(--ktp-parchment);
    border-radius: 10px;
    border: 1px solid var(--ktp-sand);
    padding: 20px 22px;
}

.ktp-v3-source-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--ktp-forest);
    margin-bottom: 2px;
}

.ktp-v3-source-sub {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--ktp-canopy);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.ktp-v3-source-card p {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 13px;
    color: var(--ktp-bark);
    line-height: 1.6;
    margin: 0;
}

/* ─── Corrections band ──────────────────────────────────────────────── */
.ktp-v3-corrections-band {
    background: var(--ktp-forest);
    padding: 48px 24px;
}

.ktp-v3-corrections-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.ktp-v3-corrections-copy h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.2;
}

.ktp-v3-corrections-copy p {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 14px;
    color: rgba(212,232,218,0.8);
    margin: 0;
    line-height: 1.65;
    max-width: 520px;
}

.ktp-v3-corrections-btn {
    background: var(--ktp-amber);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.ktp-v3-corrections-btn:hover {
    opacity: 0.88;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ktp-v3-stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ktp-v3-species-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .ktp-v3-corrections-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .ktp-v3-corrections-copy p {
        max-width: 100%;
    }
}

@media (max-width: 760px) {
    .ktp-v3-hero {
        padding: 52px 20px 48px;
    }

    .ktp-v3-hero h1 {
        font-size: 34px;
    }

    .ktp-v3-silo-grid {
        grid-template-columns: 1fr;
    }

    .ktp-v3-featured-card {
        grid-template-columns: 1fr;
    }

    .ktp-v3-pillar-stat {
        padding: 16px 24px;
    }

    .ktp-v3-state-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ktp-v3-sources-grid {
        grid-template-columns: 1fr;
    }

    .ktp-v3-shell {
        padding: 0 16px;
    }
}

@media (max-width: 540px) {
    .ktp-v3-stories-grid {
        grid-template-columns: 1fr;
    }

    .ktp-v3-species-list {
        grid-template-columns: 1fr;
    }

    .ktp-v3-search-btn {
        padding: 15px 16px;
    }
}
