/* The Dietary Health — magazine/journal theme.
   Extracted from the original hand-built templates/index.html so the exact
   same look can be driven by CMS-managed Dynamic Zone components instead of
   hardcoded HTML. */
:root {
    --bg: #f6f7f4;
    --ink: #0f1f0f;
    --muted: #58675c;
    --accent: #2ecc71;
    --accent-dark: #1f9b53;
    --paper: #ffffff;
    --stroke: #dbe4d8;
    --shadow: 0 24px 70px rgba(18, 58, 34, 0.16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.grid-backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(46,204,113,0.15), transparent 32%),
        radial-gradient(circle at 80% 12%, rgba(31,155,83,0.12), transparent 30%),
        radial-gradient(circle at 60% 78%, rgba(46,204,113,0.12), transparent 35%);
    pointer-events: none;
    z-index: -2;
}
.grid-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(15,31,15,0.08) 1px, transparent 0);
    background-size: 26px 26px;
    opacity: 0.3;
}
.shell { width: min(1180px, 94vw); margin: 0 auto; padding: 26px 0 72px; }

/* Cover */
.cover {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.spine {
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    color: #fff;
    padding: 28px 20px;
    display: grid;
    align-content: center;
    gap: 18px;
}
.spine .logo {
    width: 170px;
    height: 170px;
    border-radius: 22px;
    background: rgba(255,255,255,0.25);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4);
    overflow: hidden;
    margin: 0 auto;
}
.spine .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}
.spine .issue {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.cover-body {
    padding: 26px 26px 26px 18px;
    display: grid;
    gap: 16px;
    background: linear-gradient(135deg, rgba(46,204,113,0.08), rgba(255,255,255,0.92));
}
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.masthead h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
.tagline { color: var(--muted); max-width: 720px; font-size: 1.06rem; }
.cover-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--stroke);
    font-weight: 700;
    color: var(--muted);
}
.feature-splash {
    background: var(--paper);
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    box-shadow: 0 14px 40px rgba(24,66,38,0.1);
}
.splash-item { display: grid; gap: 6px; }
.splash-item strong { font-size: 1.1rem; }
.splash-item p { color: var(--muted); }
.cover-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: var(--shadow); }
.btn.ghost { background: #f0f4f1; color: var(--ink); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(18,58,34,0.16); }

/* Sections */
.section { margin-top: 46px; display: grid; gap: 14px; }
.section h2 { font-size: 1.8rem; }
.section p.lead { color: var(--muted); max-width: 820px; }
.section p.lead a { color: var(--accent-dark); font-weight: 700; text-decoration: underline; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tile {
    background: var(--paper);
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    gap: 10px;
    box-shadow: 0 12px 38px rgba(18,58,34,0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 44px rgba(18,58,34,0.16); }
.tile-head { display: flex; align-items: center; gap: 10px; }
.icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #e7f3ea;
    color: var(--accent-dark);
    font-size: 1.1rem;
}
.tile p { color: var(--muted); }
.byline { font-weight: 700; color: var(--ink); }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eef6f0;
    border: 1px solid var(--stroke);
    font-weight: 700;
    color: var(--muted);
}

.download {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: center;
}
.store-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #0f1f0f;
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 12px 34px rgba(15,31,15,0.3);
    border: 1px solid #1e2e1e;
}
.store-btn.alt {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--stroke);
    box-shadow: var(--shadow);
}

footer {
    margin-top: 60px;
    padding: 22px 0 32px;
    color: var(--muted);
    border-top: 1px solid var(--stroke);
    background: var(--paper);
}
.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--ink);
}
.footer-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #e7f3ea;
    display: grid;
    place-items: center;
    color: var(--accent-dark);
    border: 1px solid var(--stroke);
    overflow: hidden;
}
.footer-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.footer-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eef6f0;
    border: 1px solid var(--stroke);
    font-weight: 700;
    color: var(--muted);
}
.social-icons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.social-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    text-decoration: none;
    background: white;
    border: 1px solid var(--stroke);
    transition: all 0.3s;
    font-size: 20px;
}
.social-icon-btn.facebook { color: #1877f2; }
.social-icon-btn.facebook:hover { background: #f0f7ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2); }
.social-icon-btn.instagram { color: #e4405f; }
.social-icon-btn.instagram:hover { background: #fff5f7; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(228, 64, 95, 0.2); }
.social-icon-btn.twitter { color: #000000; }
.social-icon-btn.twitter:hover { background: #f5f5f5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

@media (max-width: 720px) {
    .cover { grid-template-columns: 1fr; }
    .spine { flex-direction: row; grid-template-columns: 1fr; justify-items: start; }
    .cover-cta, .store-buttons { flex-direction: column; }
    .btn, .store-btn { width: 100%; justify-content: center; }
}

/* Newsletter / social popup modal */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}
.popup-overlay.show { display: flex; }
.popup-modal {
    background: #ffffff;
    border-radius: 20px;
    padding: 45px 35px 35px;
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.4s ease-out;
}
.popup-close {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none;
    font-size: 28px; color: #666; cursor: pointer;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.popup-close:hover { background: #f0f0f0; color: #333; }
.popup-heading {
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px; font-weight: 700; color: #2c3e50;
    margin: 0 0 12px 0; line-height: 1.2;
}
.popup-subheading {
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px; color: #666;
    margin: 0 0 28px 0; line-height: 1.5;
}
.email-subscription { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #e8e8e8; }
.email-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.email-input {
    width: 100%; padding: 16px 20px;
    border: 2px solid #e0e0e0; border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif; font-size: 15px;
    outline: none; transition: all 0.3s; box-sizing: border-box;
}
.email-input:focus { border-color: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1); }
.email-submit {
    width: 100%; padding: 16px 28px;
    background: #2ecc71; color: white; border: none; border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.email-submit:hover { background: #1f9b53; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3); }
.email-submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.email-note { text-align: center; font-size: 13px; color: #999; margin-top: 8px; }
.social-divider { text-align: center; color: #999; font-size: 13px; margin: 22px 0 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.social-links { display: flex; flex-direction: column; gap: 12px; }
.social-button {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px;
    background: #2ecc71; color: white; text-decoration: none; border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600;
    transition: all 0.3s; box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}
.social-button:hover { background: #1f9b53; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); }
.social-button i { font-size: 18px; }
.social-button.facebook { background: #1877f2; box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3); }
.social-button.facebook:hover { background: #0c63d4; box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4); }
.social-button.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3); }
.social-button.instagram:hover { background: linear-gradient(45deg, #d67d2b 0%, #c5562e 25%, #b91f36 50%, #a91d57 75%, #9a1475 100%); box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4); }
.social-button.twitter { background: #000000; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
.social-button.twitter:hover { background: #1a1a1a; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 720px) {
    .popup-modal { padding: 35px 25px 30px; max-width: 95%; }
    .popup-heading { font-size: 26px; }
    .popup-subheading { font-size: 14px; }
    .email-input, .email-submit { padding: 14px 18px; font-size: 14px; }
    .social-button { padding: 13px 20px; font-size: 14px; }
    .social-button i { font-size: 16px; }
}
