/* ============================================
   PEN-A-PAL — style.css
   ============================================ */

/* === Variables === */
:root {
    --cream: #FFFDF5;
    --warm-white: #FFFEF9;
    --ink: #2C2416;
    --ink-light: #7A6A50;
    --accent: #F06292;
    --accent-light: #FDE8F0;
    --accent-hover: #E04080;
    --gold: #E8C84A;
    --gold-dark: #C9A828;
    --gold-light: #FFFBE8;
    --border: #F0E8C8;
    --shadow: rgba(44, 36, 22, 0.08);
    --font-display: 'Pacifico', cursive;
    --font-body: 'Nunito', sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }

/* === Nav === */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.75rem;
    background: var(--warm-white);
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.5rem;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.01em;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-light);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* === Hero === */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.25rem 2rem;
    gap: 2rem;
}

.hero-content { width: 100%; }

.hero-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 9vw, 5rem);
    color: var(--accent);
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-sub {
    font-size: 1rem;
    color: var(--ink-light);
    margin-bottom: 1.75rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* === Envelope === */
.hero-decoration {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.envelope {
    width: 220px;
    height: 157px;
    position: relative;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.envelope-flap {
    width: 0;
    height: 0;
    border-left: 110px solid transparent;
    border-right: 110px solid transparent;
    border-top: 70px solid var(--gold);
    position: absolute;
    top: 0;
    z-index: 2;
    filter: drop-shadow(0 2px 4px var(--shadow));
}

.envelope-body {
    width: 220px;
    height: 157px;
    background: var(--gold-light);
    border-radius: 4px;
    border: 2px solid var(--gold);
    position: absolute;
    top: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.75rem;
}

.letter-peek {
    background: white;
    border: 1px solid var(--border);
    padding: 0.6rem 0.85rem;
    width: 172px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--ink-light);
    line-height: 1.6;
    box-shadow: 0 -4px 12px var(--shadow);
}

.letter-peek p { margin-bottom: 0.25rem; }
.sticker-dots { margin-top: 0.4rem; font-size: 0.9rem; letter-spacing: 0.3em; }

/* === Buttons === */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 0.9rem 2rem;
    border-radius: 99px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(240, 98, 146, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 98, 146, 0.4);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary.full-width { width: 100%; text-align: center; }

/* === Info Section === */
.info-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
}

.info-section h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    color: var(--accent);
    margin-bottom: 0.75rem;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: var(--ink-light);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    font-size: 1rem;
}

/* === Cards === */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.card {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(232, 200, 74, 0.3);
    transform: translateY(-4px);
}

.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.card p { color: var(--ink-light); font-size: 0.95rem; }

/* === CTA Section === */
.cta-section {
    background: var(--gold);
    color: var(--ink);
    text-align: center;
    padding: 3rem 1.5rem;
}

.cta-section h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 0.75rem;
    color: var(--ink);
}

.cta-section p {
    opacity: 0.75;
    margin-bottom: 1.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.cta-section .btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(44, 36, 22, 0.15);
}

.cta-section .btn-primary:hover { background: var(--accent-hover); }

/* === Page Hero === */
.page-hero {
    background: var(--gold-light);
    border-bottom: 2px solid var(--gold);
    text-align: center;
    padding: 2.5rem 1.25rem 2rem;
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 5vw, 2.8rem);
    color: var(--accent);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.page-hero p {
    color: var(--ink-light);
    font-size: 1rem;
    font-weight: 600;
}

/* === About Grid === */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.about-grid.reverse { direction: ltr; }

.about-text h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 5vw, 1.75rem);
    color: var(--accent);
    margin-bottom: 0.75rem;
    text-align: left;
}

.about-text p { color: var(--ink-light); margin-bottom: 1rem; }

.about-image-placeholder {
    background: var(--gold-light);
    border: 2px solid var(--gold);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 0.75rem;
}

.about-image-placeholder span { font-size: 3rem; }

.about-image-placeholder p {
    color: var(--ink-light);
    font-style: italic;
    font-family: var(--font-display);
    font-size: 0.85rem;
}

/* === Pricing === */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.pricing-card {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(232, 200, 74, 0.3);
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(240, 98, 146, 0.15);
}

.pricing-badge {
    background: var(--accent);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.85rem;
    border-radius: 99px;
    display: inline-block;
    width: fit-content;
}

.pricing-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}

.price span { font-size: 1rem; font-weight: 400; color: var(--ink-light); }

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    margin-bottom: 0.5rem;
}

.feature-list li { font-size: 0.95rem; color: var(--ink-light); font-weight: 600; }

/* === FAQ === */
.faq h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-item {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.faq-item h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.faq-item p { color: var(--ink-light); font-size: 0.95rem; }

/* === Auth === */
.auth-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-card {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 32px rgba(232, 200, 74, 0.2);
}

.form-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.1rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.form-group input,
.form-group select {
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--gold);
    border-radius: 10px;
    background: white;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* === Blog === */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.blog-card {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(232, 200, 74, 0.3);
}

.blog-card h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent);
    text-align: left;
    margin-bottom: 0;
}

.blog-card h2 a { text-decoration: none; color: var(--accent); transition: color 0.2s; }
.blog-card h2 a:hover { color: var(--accent-hover); }

.blog-date {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

.blog-excerpt { color: var(--ink-light); font-size: 0.95rem; flex: 1; }

.read-more {
    display: inline-block;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s;
}

.read-more:hover { color: var(--accent-hover); }

.loading-msg {
    text-align: center;
    color: var(--ink-light);
    font-size: 1rem;
    padding: 3rem 0;
    grid-column: 1 / -1;
}

.empty-msg {
    text-align: center;
    color: var(--ink-light);
    padding: 3rem 0;
    grid-column: 1 / -1;
}

.empty-msg span { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* === Blog Post === */
.post-wrapper {
    max-width: 580px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    color: var(--accent);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.post-date {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 1.5rem;
    display: block;
}

.post-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin-bottom: 2rem;
}

.post-body { color: var(--ink-light); font-size: 1.05rem; line-height: 1.85; }
.post-body p { margin-bottom: 1.25rem; }
.post-body h2 { font-family: var(--font-display); color: var(--accent); margin: 2rem 0 0.75rem; }
.post-body h3 { font-family: var(--font-display); color: var(--ink); margin: 1.5rem 0 0.5rem; }

/* === Admin === */
.admin-wrapper {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1.25rem 4rem;
}

.admin-wrapper h2 {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.admin-wrapper input,
.admin-wrapper textarea {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--gold);
    border-radius: 10px;
    background: white;
    color: var(--ink);
    transition: border-color 0.2s;
}

.admin-wrapper input:focus,
.admin-wrapper textarea:focus { outline: none; border-color: var(--accent); }
.admin-wrapper textarea { height: 300px; resize: vertical; }

/* === Footer === */
footer {
    background: var(--ink);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 1.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.7;
}

/* === Quiz Hub === */
.quiz-hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-hub-card {
    background: var(--warm-white);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.quiz-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(232, 200, 74, 0.3);
    border-color: var(--accent);
}

.quiz-hub-emoji { font-size: 2.2rem; line-height: 1; }

.quiz-hub-tag {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 12px;
    border-radius: 99px;
    display: inline-block;
    width: fit-content;
}

.quiz-hub-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0;
    text-align: left;
}

.quiz-hub-card p { color: var(--ink-light); font-size: 0.9rem; line-height: 1.5; flex: 1; }
.quiz-hub-card .question-count { font-size: 0.8rem; font-weight: 800; color: var(--gold-dark); }

/* ============================================
   TABLET 600px+
   ============================================ */
@media (min-width: 600px) {
    .cards { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .quiz-hub-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
    .about-grid.reverse { direction: rtl; }
    .about-grid.reverse > * { direction: ltr; }
    .info-section { padding: 3rem 2rem 4rem; }
    .page-hero { padding: 3rem 2rem 2.5rem; }
    .post-wrapper { padding: 2.5rem 2rem 4rem; }
    .cta-section { padding: 4rem 2rem; }
}

/* ============================================
   DESKTOP 900px+
   ============================================ */
@media (min-width: 900px) {
    nav { padding: 1.2rem 2.5rem; }
    .nav-logo { font-size: 1.5rem; }
    .nav-links { gap: 2rem; }
    .nav-links a { font-size: 0.9rem; letter-spacing: 0.04em; }

    .hero {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 5rem 2.5rem 4rem;
        max-width: 1100px;
        margin: 0 auto;
        gap: 3rem;
    }

    .hero-content { flex: 1; max-width: 560px; }
    .hero-sub { margin-left: 0; margin-right: 0; }

    .envelope { width: 280px; height: 200px; }
    .envelope-flap {
        border-left: 140px solid transparent;
        border-right: 140px solid transparent;
        border-top: 90px solid var(--gold);
    }
    .envelope-body { width: 280px; height: 200px; }
    .letter-peek { width: 220px; font-size: 0.75rem; padding: 0.75rem 1rem; }
    .sticker-dots { font-size: 1rem; }

    .info-section { padding: 3rem 2.5rem 4rem; }
    .cards { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
    .card { padding: 2rem; }
    .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
    .blog-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .quiz-hub-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .about-grid { gap: 3rem; margin-bottom: 4rem; }
    .page-hero { padding: 4rem 2rem 3rem; }
    .post-wrapper { padding: 3rem 2rem 5rem; }
    .form-row { grid-template-columns: 1fr 1fr; }
}