/* =========================================================
   INDICA TIMES NEWSPAPER STYLESHEET
   Pottery-inspired light/dark colour system
   ========================================================= */

:root {
    /* =========================================================
       POTTERY PALETTE
       ========================================================= */
    --newspaper-ash: #E5E6E1;
    --soot-black: #1A1A1A;
    --charcoal: #5F6266;
    --silt: #A8ABA4;
    --terracotta: #C84B31;
    --clay: #E8D3C7;
    --ochre: #E0A96D;
    /* =========================================================
       NEWSPAPER INSERT / FLYER
       ========================================================= */
    --flyer-paper: #EAE6E1;
    --flyer-text: #29231b;
    --flyer-muted: #665b4b;
    --flyer-rule: #8b7d66;
    --flyer-accent: #AA4A44;
    --flyer-accent-secondary: #a77b32;
    --flyer-serif: Georgia, "Times New Roman", Times, serif;
    --flyer-sanserif: "Trebuchet MS";
    --flyer-script: "Segoe Print", "Bradley Hand", cursive;
    /* =========================================================
       LIGHT THEME
       ========================================================= */
    --page-bg: var(--newspaper-ash);
    --paper: var(--clay);
    --text: var(--soot-black);
    --muted-text: var(--charcoal);
    --rule-color: var(--silt);
    --accent: var(--terracotta);
    --accent-secondary: var(--ochre);
    /* =========================================================
       LAYOUT
       ========================================================= */
    --max-width: 1200px;
    --rule: 1px solid var(--rule-color);
    --heavy-rule: 3px solid var(--text);
    --page-padding: 1.25rem;
    --column-gap: 1.25rem;
    /* =========================================================
       TYPOGRAPHY
       ========================================================= */
    --serif: Georgia, "Times New Roman", Times, serif;
    --sans: Arial, Helvetica, sans-serif;
}

/* =========================================================
   DARK THEME
   ========================================================= */
[data-theme="dark"] {
    --page-bg: var(--soot-black);
    --paper: var(--charcoal);
    --text: var(--newspaper-ash);
    --muted-text: var(--silt);
    --rule-color: var(--silt);
    --accent: var(--terracotta);
    --accent-secondary: var(--ochre);
}

/* =========================================================
   GLOBAL
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--page-bg);
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: var(--serif);
    line-height: 1.55;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================================
   NEWSPAPER PAGE
   ========================================================= */
.page {
    width: min(100% - 2rem, var(--max-width));
    margin: 1rem auto;
    padding: var(--page-padding);
    background: var(--paper);
    box-shadow:
        0 0 0 1px var(--rule-color),
        0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .page {
    box-shadow:
        0 0 0 1px var(--rule-color),
        0 4px 20px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   MASTHEAD
   ========================================================= */
.masthead {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    min-height: 5rem;
    border-top: var(--heavy-rule);
    border-bottom: 1px solid var(--text);
}

.masthead-price {
    text-align: left;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.masthead-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.12em;
    margin: 0;
    white-space: nowrap;
    font-family: var(--serif);
    font-size: 3rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.08rem;
}

.masthead-name img {
    display: block;
    width: 1.15em;
    height: 1.15em;
    object-fit: contain;
    flex: 0 0 auto;
}

.masthead-share {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.masthead-share button,
.masthead-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--text);
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.masthead-share button:hover,
.masthead-share a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* =========================================================
   SECONDARY MASTHEAD ROW
   ========================================================= */
.edition-bar {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    min-height: 2.25rem;
    border-bottom: var(--heavy-rule);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.edition-date {
    text-align: left;
}

.edition-motto {
    text-align: center;
}

.edition-number {
    text-align: right;
}

/* =========================================================
   GENERIC STORY STYLES
   ========================================================= */
.story {
    min-width: 0;
}

.story h2,
.story h3 {
    margin-top: 0;
    margin-bottom: 0.05rem;
    font-family: var(--serif);
    color: var(--text);
    line-height: 1.05;
}

.story p {
    margin-top: 0.05rem;
}

.story-label {
    margin-bottom: 0.05rem;
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.story-link {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================
   ROW THREE
   LEAD + SMALL FEATURE
   67% + 33%
   ========================================================= */
.row-lead {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--column-gap);
    padding: 1.25rem 0;
    border-bottom: var(--rule);
}

.lead-story {
    padding-right: var(--column-gap);
    border-right: var(--rule);
}

.lead-story h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.lead-story .lead {
    font-size: 1.15rem;
    line-height: 1.5;
}

.small-feature {
    padding-left: 0;
}

.small-feature h3 {
    font-size: 1.6rem;
}

/* =========================================================
   ROW FOUR
   TWO SECONDARY STORIES
   50% + 50%
   ========================================================= */
.row-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--column-gap);
    padding: 1.25rem 0;
    border-bottom: var(--rule);
}

.secondary-story {
    padding-right: var(--column-gap);
}

.secondary-story + .secondary-story {
    padding-left: var(--column-gap);
    padding-right: 0;
    border-left: var(--rule);
}

.secondary-story h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

/* =========================================================
   ROW FIVE
   FEATURE + PERMANENT STORY
   33% + 67%
   ========================================================= */
.row-permanent {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--column-gap);
    padding: 1.25rem 0;
    border-bottom: var(--heavy-rule);
}

.permanent-story {
    padding-left: var(--column-gap);
    border-left: var(--rule);
}

.permanent-story h2 {
    font-size: 1.8rem;
}

.fifth-feature {
    padding-left: 0;
}

/* =========================================================
   FOOTNOTES
   ========================================================= */
.footnote {
    margin-top: 0;
    padding: 0.75rem 0 1rem;
    font-size: 0.78rem;
    line-height: 1.4;
    border-bottom: var(--rule);
    color: var(--muted-text);
}

.footnote h2,
.footnote h3,
.footnote h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
}

.footnote ol {
    margin-bottom: 0;
    margin-top: 0;
    padding-left: 1.5rem;
}

.footnote hr {
    display: none;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--column-gap);
    padding-top: 1.25rem;
    font-family: var(--sans);
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--muted-text);
}

.site-footer h3 {
    margin: 0 0 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}

.site-footer p {
    margin: 0 0 0.5rem;
}

.footer-subscribe {
    font-weight: 700;
}

.footer-copyright {
    text-align: left;
}

.footer-links {
    text-align: center;
}

.footer-contact {
    text-align: right;
}

/* =========================================================
   SPECIAL NEWSPAPER ELEMENTS
   ========================================================= */
.byline {
    margin: 0.05rem 0 0.4rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted-text);
}

.dateline {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted-text);
}

.dropcap::first-letter {
    float: left;
    margin: 0.05em 0.08em 0 0;
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.8;
    color: var(--accent);
}

blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--rule-color);
    border-bottom: 1px solid var(--rule-color);
    font-size: 1.15rem;
    font-style: italic;
}

hr {
    border: 0;
    border-top: 1px solid var(--rule-color);
}

/* =========================================================
   CUSTOMER SERVICE
   ========================================================= */
.customer-service-options {
    margin: 1rem 0 0;
    padding-left: 1.5rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    line-height: 1.45;
}

.customer-service-options li {
    margin-bottom: 0.35rem;
    line-height: 1.45;
}

.customer-service-options a {
    font-weight: 700;
    text-decoration: none;
}

.customer-service-options a:hover {
    text-decoration: underline;
}

/* =========================================================
   PERMANENT STORY
   ========================================================= */
.permanent-story h2 {
    margin-bottom: 0.05rem;
    font-family: var(--sans);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.permanent-story .lead {
    margin-top: 0;
    font-size: 1.15rem;
    font-style: italic;
}

/* =========================================================
   SIMPLE LAYOUT
   ========================================================= */
.simple-page {
    width: min(100% - 2rem, 800px);
    margin: 3rem auto;
}

.simple-header {
    padding-bottom: 1rem;
    border-bottom: var(--heavy-rule);
}

.simple-logo {
    color: var(--text);
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 900;
    text-decoration: none;
}

.simple-content {
    padding: 2rem 0;
}

.simple-content h1 {
    font-size: 2.5rem;
    line-height: 1.1;
}

.simple-footer {
    padding-top: 1rem;
    border-top: var(--rule);
    font-family: var(--sans);
    font-size: 0.75rem;
    color: var(--muted-text);
}

/* =========================================================
   TABLES, JUST IN CASE
   ========================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sans);
    font-size: 0.8rem;
}

th,
td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--rule-color);
    text-align: left;
}

th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--text);
}

/* =========================================================
   BUTTON FOR NEWSPAPER INSERT / FLYER
   ========================================================= */
.flyer-button {
  display: inline-block;
  padding: 0.45rem 1.75rem;
  margin: 15px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  font-family: var(--flyer-sanserif);
  background: var(--flyer-accent);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.flyer-button:hover {
  background: var(flyer-rule);
  color: black;
}

.flyer-button:active {
  transform: translateY(1px);
}

/* =========================================================
   NEWSPAPER INSERT / FLYER
   ========================================================= */

/* The darkened area behind the flyer */
.flyer-modal {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  display:flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* JavaScript adds this class when the flyer is open */
.flyer-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* The actual newspaper insert */
.flyer {
  position: relative;
  width: min(700px, 100%);
  max-height: 96vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 3rem 3.5rem;
  background: var(--flyer-paper);
  /* Add a soft fibre overlay */
  background-image:
    linear-gradient(rgba(0,0,0,0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.01) 1px, transparent 1px);
  background-size: 2px 2px;
  color: var(--flyer-text);
  border: 1px solid var(--flyer-accent);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.2);
  font-family: var(--flyer-sanserif);
}

/* Decorative line around the contents */
.flyer::before {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border: 1px solid var(--flyer-accent);
  pointer-events: none;
}

/* Flyer heading */
.flyer h1 {
  margin-top: 0;
  margin-bottom: 0.2rem;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.1;
  font-family: var(--flyer-script);
  color: var(--flyer-accent);
}

/* Flyer subheadings */
.flyer h2{
  text-align: center;
  font-size: 1.2rem;
}

/* Normal flyer text */
.flyer p {
  line-height: 1.3;
}

/* Flyer horizontal rule */
.flyer hr {
  color: var(--flyer-rule)
}

/* Flyer blockquote */
.flyer blockquote {
    margin: 1rem 0;
    padding: 0.25rem 0.75rem;
    border-top: 1px solid var(--flyer-rule);
    border-bottom: 1px solid var(--flyer-rule);
    font-size: 0.95rem;
    color: var(--flyer-accent);
}

/* The Discard button */
.flyer-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 2;
  padding: 0.25rem 0.6rem;
  border: 1px solid  var(--flyer-muted);
  background: transparent;
  color:  var(--flyer-muted);
  font-family: var(--flyer-serif);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  cursor: pointer;
}

/* Button hover */
.flyer-close:hover {
  background: var(--flyer-text);
  color:  var(--flyer-paper);
}

/* Keyboard focus */
.flyer-close:focus-visible {
  outline: 2px solid #211d17;
  outline-offset: 2px;
}

/* Prevent the page behind the flyer from scrolling */
body.flyer-open {
  overflow: hidden;
}

/* =========================================================
   BUTTON FOR HELPLINE TICKETS
   ========================================================= */
.ticket-button {
  border: 2px solid var(--flyer-accent);
  background: var(--clay);
  color: var(--soot-black);
  padding: 2px 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-family: var(--flyer-sanserif);
  font-size: 0.7rem;
  letter-spacing: 2px;
  margin: 4px 2px;
  border-radius: 9px;
  cursor: pointer;
}

.ticket-button:hover {
  background: var(--flyer-accent);
  color: white;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 700px) {
    .page {
        width: 100%;
        margin: 0;
        padding: 0.9rem;
        box-shadow: none;
    }

    .masthead {
        grid-template-columns: 1fr auto;
        padding: 0.75rem 0;
    }

    .masthead-name {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 2rem;
    }

    .masthead-name img {
        width: 1em;
        height: 1em;
    }

    .masthead-price {
        grid-column: 1;
        grid-row: 2;
    }

    .masthead-share {
        grid-column: 2;
        grid-row: 2;
    }

    .edition-bar {
        grid-template-columns: 1fr 1fr;
        padding: 0.5rem 0;
    }

    .edition-motto {
        display: none;
    }

    .edition-date {
        text-align: left;
    }

    .edition-number {
        text-align: right;
    }

    .row-lead,
    .row-secondary,
    .row-permanent {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .lead-story,
    .secondary-story,
    .permanent-story {
        padding: 0 0 1rem;
        border-right: 0;
        border-left: 0;
    }

    .secondary-story + .secondary-story {
        padding: 1rem 0 0;
        border-left: 0;
        border-top: var(--rule);
    }

    .small-feature,
    .fifth-feature {
        padding: 1rem 0 0;
        border-top: var(--rule);
    }

    .site-footer {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .footer-copyright,
    .footer-links,
    .footer-contact {
        text-align: left;
    }

	.flyer-modal {
    padding: 0.75rem;
    }

	.flyer {
    width: 100%;
    max-height: 92vh;
    padding: 2.5rem 1.5rem 2rem;
    }

	.flyer::before {
    inset: 0.5rem;
    }

	.flyer h1 {
    font-size: 1.5rem;
    }

    .flyer h2 {
    font-size: 1.2rem;
    }

	.flyer-close {
    top: 0.9rem;
    right: 1rem;
    }
}