/* ================================
   8 Athens · Unit 2 summative (Comics in Advertising Presentation)
   Layers on site.css + assignment.css.
   The Berry palette is scoped to body.theme-berry, so no other page changes.
   ================================ */

.theme-berry {
    --berry-deep: #4A1029;   /* headings, header band */
    --berry: #9B2242;        /* links, active tabs, table header rows */
    --berry-light: #C4587A;  /* borders, card outlines, hover */
    --berry-wash: #F7E9EE;   /* section backgrounds, alternate rows */

    /* Feed the shared accent tokens used by site.css and assignment.css */
    --accent: var(--berry);
    --accent-tint: #E9B8C8;
    --accent-pale: var(--berry-wash);
    --accent-band: var(--berry-wash);
    --hairline: #E8D3DB;
}

.theme-berry .site-header { background: var(--berry-deep); }
.theme-berry .lang-toggle button.is-active { color: var(--berry-deep); }

/* Headings */
.theme-berry .assignment-hero h1,
.theme-berry .block h2,
.theme-berry .block h3,
.theme-berry .block h4,
.theme-berry .block h5 { color: var(--berry-deep); }

.theme-berry .block h2 { border-bottom-color: var(--berry); scroll-margin-top: 16px; }
.theme-berry .block { scroll-margin-top: 16px; }

.theme-berry .block h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 24px 0 8px;
}

/* Links in content */
.theme-berry .block a:not(.btn) {
    color: var(--berry);
    text-decoration: underline;
    text-decoration-color: var(--berry-light);
    text-underline-offset: 3px;
}
.theme-berry .block a:not(.btn):hover { text-decoration-color: var(--berry); text-decoration-thickness: 2px; }
.theme-berry .block a.ph { color: #1F2421; text-decoration: none; }

/* Jump menu */
.theme-berry .jump a { border-color: var(--berry-light); color: var(--berry); }
.theme-berry .jump a:hover,
.theme-berry .jump a:focus-visible { background: var(--berry-wash); color: var(--berry-deep); border-color: var(--berry); }

/* Focus ring */
.theme-berry a:focus-visible,
.theme-berry button:focus-visible,
.theme-berry [role="tabpanel"]:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }

/* Placeholders Colin still has to fill */
.ph {
    background: #FFE45C;
    color: #1F2421;
    padding: 0 4px;
    font-weight: 600;
    border-radius: 2px;
}

/* Wash sections */
.wash {
    background: var(--berry-wash);
    border-left: 8px solid var(--berry);
    padding: 4px 32px 24px;
}
.wash h2 { border-bottom-color: var(--berry-light) !important; }

/* ---------- Overview comparison table ---------- */
.compare {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--berry-light);
    margin-top: 8px;
}
.compare th,
.compare td {
    border: 1px solid var(--berry-light);
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink-secondary);
}
.compare thead th { background: var(--berry); color: #FFFFFF; font-weight: 600; }
.compare thead td { background: var(--berry); }
.compare tbody th { width: 11rem; background: var(--berry-wash); color: var(--berry-deep); font-weight: 700; }
.compare tbody td { width: calc((100% - 11rem) / 2); }

/* ---------- Option tabs ---------- */
.opt-tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 3px solid var(--berry);
    margin: 8px 0 20px;
}
.opt-tab {
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    padding: 10px 20px;
    background: #FFFFFF;
    color: var(--berry);
    border: 1px solid var(--berry-light);
    border-bottom: none;
    margin-right: -1px;
    cursor: pointer;
}
.opt-tab:hover { background: var(--berry-wash); border-color: var(--berry-light); }
.opt-tab[aria-selected="true"] { background: var(--berry); color: #FFFFFF; border-color: var(--berry); }

/* Without tabs (no JavaScript), panels stack with a clear divider */
[data-opt-tabs]:not(.is-tabbed) > [data-opt] + [data-opt] {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px dashed var(--berry-light);
}

.opt-label {
    font-size: 1.0625rem !important;
    font-weight: 700;
    color: var(--berry-deep) !important;
    margin: 4px 0 6px;
}

/* Success criteria */
.criteria-block { margin-top: 28px; }
.criteria-block > h3 { margin-top: 0; }
.criteria-block .opt-tablist { margin-top: 4px; }
.can-list { max-width: 72ch; }

/* ---------- Rubrics ---------- */
.rubric-panel > h3 { margin-top: 4px; }
.theme-berry .criterion h4 { margin: 0 0 10px; }
.theme-berry .criterion { margin-top: 28px; }
.theme-berry .criterion table,
.theme-berry .criterion th,
.theme-berry .criterion td { border-color: var(--berry-light); }
.theme-berry .criterion thead th { background: var(--berry); }
.theme-berry .criterion tbody th {
    width: 5.5rem;
    background: #FFFFFF;
    color: var(--berry-deep);
}
.theme-berry .criterion tbody tr:nth-child(even) th,
.theme-berry .criterion tbody tr:nth-child(even) td { background: var(--berry-wash); }

/* ---------- Approved choices: cards ---------- */
.choice-intro { max-width: 70ch; }

.cards {
    list-style: none;
    padding: 0 !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 12px;
}
.cards > li { margin: 0; }

.card {
    height: 100%;
    border: 1px solid var(--berry-light);
    border-top: 6px solid var(--berry);
    padding: 16px 20px 18px;
    background: #FFFFFF;
}
.card h5 {
    font-family: var(--font-heading);
    font-size: 1.3125rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 10px;
}
.card dl { margin: 0; }
.card dl > div { padding: 7px 0; border-top: 1px solid var(--hairline); }
.card dt {
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--berry-deep);
}
.card dd {
    margin: 2px 0 0;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--ink-secondary);
}

.harder {
    margin-top: 32px;
    border: 1px dashed var(--berry-light);
    background: var(--berry-wash);
    padding: 4px 20px 20px;
}
.harder .card { background: #FFFFFF; }
.harder > h4 { margin-top: 16px !important; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .wash { padding: 4px 20px 18px; }
    .cards { grid-template-columns: 1fr; }
    .harder { padding: 4px 14px 16px; }
    .opt-tab { flex: 1 1 50%; padding: 10px 12px; font-size: 1rem; text-align: center; }

    /* Stack the comparison table: one block per row */
    .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto !important; }
    .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .compare { border: none; }
    .compare tr { border: 1px solid var(--berry-light); margin-bottom: 14px; }
    .compare th, .compare td { border: none; }
    .compare tbody th { background: var(--berry); color: #FFFFFF; }
    .compare tbody td { border-top: 1px solid var(--berry-light); }
    .compare tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.875rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-weight: 700;
        color: var(--berry-deep);
        margin-bottom: 2px;
    }
}

/* ---------- Print ---------- */
@media print {
    .opt-tablist { display: none !important; }
    [data-opt-tabs] > [data-opt],
    [data-opt-tabs] > [data-opt][hidden] { display: block !important; }
    [data-opt-tabs] > [data-opt] + [data-opt] {
        margin-top: 18px;
        padding-top: 12px;
        border-top: 1px dashed #000;
    }

    .theme-berry .assignment-hero h1,
    .theme-berry .block h2,
    .theme-berry .block h3,
    .theme-berry .block h4,
    .theme-berry .block h5,
    .opt-label,
    .card dt { color: #000 !important; }

    .wash, .harder { background: #fff; border: 1px solid #000; border-left-width: 6px; }
    .ph { background: #FFE45C; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .theme-berry .block a:not(.btn) { color: #000; }

    .compare, .compare th, .compare td { border-color: #000; }
    .compare thead th, .compare thead td, .compare tbody th { background: #fff; color: #000; }
    .compare thead th { border-bottom: 2px solid #000; }

    .theme-berry .criterion { break-inside: auto; }
    .theme-berry .criterion h4 { break-after: avoid; }
    .theme-berry .criterion table, .theme-berry .criterion th, .theme-berry .criterion td { border-color: #000; }
    .theme-berry .criterion thead th,
    .theme-berry .criterion tbody th,
    .theme-berry .criterion tbody tr:nth-child(even) th,
    .theme-berry .criterion tbody tr:nth-child(even) td { background: #fff; color: #000; }
    .theme-berry .criterion thead th { border-bottom: 2px solid #000; }
    .block h2, .block h3, .block h4, .block h5, .opt-label { break-after: avoid; page-break-after: avoid; }
    tr, .card, .cards > li { break-inside: avoid; page-break-inside: avoid; }
    thead { display: table-header-group; }

    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { border-color: #000; border-top-color: #000; }

    /* Checklists print with an empty box to tick by hand */
    .can-list, .planner-list { list-style: none; padding-left: 0 !important; }
    .can-list li::before, .planner-list li::before { content: "\2610\00a0\00a0"; font-size: 1.1em; }
    .can-list li, .planner-list li { break-inside: avoid; }
}
