/* =============================================
   Italian Weekly v4 — Frontend Styles
   ============================================= */

/* --- City card --- */
.iw-city-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    max-width: 600px;
}
.iw-city-img {
    height: 200px;
    background-color: #6b7c93;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}
.iw-city-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.55) 100%);
}
.iw-city-label {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    color: #fff;
}
.iw-city-pre  { font-size: 11px; opacity: .85; margin-bottom: 2px; }
.iw-city-name { font-size: 26px; font-weight: 600; }
.iw-city-footer { padding: .75rem 1rem; }

.iw-open-modal {
    background: none;
    border: none;
    color: #5b50cc;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: color .15s;
}
.iw-open-modal:hover { color: #3c348f; }
.iw-arrow { font-size: 18px; line-height: 1; }

/* --- Word card --- */
.iw-word-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.iw-word-label    { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.iw-word-main     { font-size: 32px; font-weight: 600; color: #5b50cc; line-height: 1.2; }
.iw-word-phonetic { font-size: 14px; color: #888; font-style: italic; }
.iw-word-desc     { font-size: 14px; color: #555; margin: 6px 0 0; line-height: 1.6; }

/* --- Audio player --- */
.iw-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px;
}
.iw-play-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #5b50cc;
    border: none; color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.iw-play-btn:hover  { background: #3c348f; }
.iw-play-btn:active { transform: scale(.95); }
.iw-play-btn.iw-playing { background: #2e7d32; }
.iw-audio-label { font-size: 13px; color: #555; }

/* --- Modal overlay --- */
.iw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.iw-modal-overlay.iw-open { display: flex; }

.iw-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
}

/* --- Modal header --- */
.iw-modal-header {
    height: 180px;
    background-color: #6b7c93;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    flex-shrink: 0;
}
.iw-modal-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.05) 0%, rgba(0,0,0,.6) 100%);
}
.iw-modal-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    color: #fff;
}
.iw-modal-pre  { font-size: 11px; opacity: .8; margin-bottom: 2px; }
.iw-modal-city { font-size: 24px; font-weight: 600; }
.iw-modal-close {
    position: absolute;
    top: .75rem; right: .75rem;
    z-index: 3;
    background: rgba(255,255,255,.2);
    border: none; color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.iw-modal-close:hover { background: rgba(255,255,255,.35); }

/* --- Tab row (7 tabs, always one line) --- */
.iw-tab-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: .875rem .875rem 0;
    flex-shrink: 0;
}

.iw-tab {
    padding: 7px 4px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,.1);
    background: #f5f5f5;
    color: #888;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    transition: all .15s;
    position: relative;
    line-height: 1.3;
}
.iw-tab-label { font-size: 11px; }

.iw-tab-unlocked {
    background: #fff;
    border-color: rgba(0,0,0,.12);
    color: #444;
    cursor: pointer;
}
.iw-tab-unlocked:hover { background: #f0eeff; border-color: #afa9ec; color: #3c348f; }

.iw-tab-today {
    background: #EEEDFE;
    border-color: #AFA9EC;
    color: #3C3489;
    font-weight: 600;
}
.iw-tab-today:hover { background: #e0defe; }

.iw-tab-active {
    background: #EEEDFE !important;
    border-color: #AFA9EC !important;
    color: #3C3489 !important;
    font-weight: 600;
}

.iw-tab-locked {
    opacity: .45;
    cursor: not-allowed;
}
.iw-tab-locked .ti { font-size: 10px; }

.iw-tab-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #5b50cc;
    display: block;
}

/* --- Modal body / panels --- */
.iw-modal-body {
    padding: .875rem;
    overflow-y: auto;
    flex: 1;
}

.iw-tab-panel[hidden] { display: none; }

.iw-today-banner {
    margin-bottom: 10px;
}
.iw-today-pill {
    background: #EEEDFE;
    color: #3C3489;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}

.iw-panel-content {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}
.iw-panel-content p            { margin: 0 0 .75rem; }
.iw-panel-content p:last-child { margin-bottom: 0; }
.iw-panel-content ul,
.iw-panel-content ol           { padding-left: 1.4rem; margin: 0 0 .75rem; }
.iw-panel-content li           { margin-bottom: 5px; }
.iw-panel-content img          { max-width: 100%; border-radius: 8px; height: auto; display: block; margin: .75rem 0; }
.iw-panel-content figure       { margin: .75rem 0; }
.iw-panel-content figcaption   { font-size: 12px; color: #888; text-align: center; margin-top: 4px; }
.iw-panel-content h2           { font-size: 16px; font-weight: 600; margin: 1rem 0 .5rem; }
.iw-panel-content h3           { font-size: 14px; font-weight: 600; margin: .75rem 0 .4rem; }

/* Video embed — responsive 16:9 */
.iw-panel-content .wp-block-embed__wrapper,
.iw-panel-content .wp-video {
    position: relative;
    padding-top: 56.25%;
    margin: .75rem 0;
}
.iw-panel-content .wp-block-embed__wrapper iframe,
.iw-panel-content .wp-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.iw-no-content { color: #888; font-size: 14px; font-style: italic; }
