/*
Theme Name: Tiruchendur Sacred Coast
Theme URI: https://tiruchendur.org/
Author: Tiruchendur.org
Description: A Tamil-first archival gateway for Tiruchendur.org that unifies WordPress posts and preserved legacy HTML resources.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tiruchendur-sacred-coast
*/

:root {
  --ink: #142523;
  --muted: #536460;
  --paper: #f7f3ea;
  --cream: #eee7d8;
  --line: #d8d0bf;
  --ocean: #0f555b;
  --deep-ocean: #082f34;
  --saffron: #d5742f;
  --white: #fff;
  --serif: Georgia, "Noto Serif Tamil", "Noto Serif Malayalam", "Noto Serif Devanagari", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Tamil", "Noto Sans Malayalam", "Noto Sans Devanagari", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.screen-reader-text { clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; width: 1px; }
.skip-link:focus { background: var(--white); clip: auto; clip-path: none; height: auto; left: 1rem; padding: .8rem 1rem; top: 1rem; width: auto; z-index: 1000; }

.site-header { align-items: center; background: rgba(247, 243, 234, .97); border-bottom: 1px solid var(--line); display: grid; gap: .7rem 1.5rem; grid-template-areas: "branding tools" "navigation navigation"; grid-template-columns: minmax(0, 1fr) auto; padding: .85rem 4vw .6rem; position: sticky; top: 0; z-index: 50; }
.site-branding { display: flex; flex-direction: column; grid-area: branding; line-height: 1; min-width: 0; }
.site-branding strong { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 500; }
.site-branding small { color: var(--saffron); font-size: .62rem; font-weight: 800; letter-spacing: .11em; margin-top: .45rem; text-transform: uppercase; }
.header-tools { align-items: center; display: flex; gap: .8rem; grid-area: tools; justify-self: end; min-width: 0; }
.primary-nav { border-top: 1px solid var(--line); grid-area: navigation; justify-self: stretch; padding-top: .55rem; }
.primary-nav ul { align-items: center; display: flex; flex-wrap: wrap; gap: .3rem clamp(1rem, 2.25vw, 2.25rem); justify-content: center; list-style: none; margin: 0; padding: 0; }
.primary-nav a { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--saffron); }
.language-area { align-items: center; display: flex; font-size: .74rem; gap: .7rem; }
.language-area > span { color: var(--muted); }
.language-area select { background: transparent; border: 1px solid var(--line); color: var(--ink); min-height: 38px; padding: 0 .55rem; }
.language-area .gtranslate_wrapper, .language-area .gt_switcher, .language-area .gt_selected, .language-area .gt_selected > a { max-width: 173px; width: 173px !important; }
.menu-toggle { background: transparent; border: 1px solid var(--line); color: var(--ink); display: none; font-weight: 800; padding: .65rem; }

/* Keep Google's retained automatic top unit centered and responsive without
   hiding, clipping, or modifying the ad creative. */
body.home > .site-header + .google-auto-placed { clear: both !important; margin: 1rem auto !important; max-width: 728px !important; text-align: center; width: calc(100% - 2rem) !important; }
body.home > .site-header + .google-auto-placed > .adsbygoogle, body.home > .site-header + .google-auto-placed iframe { max-width: 100% !important; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr); min-height: 690px; }
.hero-copy { align-items: flex-start; display: flex; flex-direction: column; justify-content: center; padding: clamp(4rem, 8vw, 8rem) 7vw; }
.kicker { color: var(--saffron); font-size: .7rem; font-weight: 900; letter-spacing: .18em; margin: 0 0 1.35rem; text-transform: uppercase; }
.hero h1 { font-family: var(--serif); font-size: clamp(4rem, 7vw, 7.6rem); font-weight: 400; letter-spacing: -.055em; line-height: .9; margin: 0; }
.hero h1 span { display: block; font-size: .37em; letter-spacing: -.02em; line-height: 1.25; margin-top: 1.15rem; }
.hero-copy > p:not(.kicker) { color: var(--muted); font-family: var(--serif); font-size: 1.08rem; line-height: 1.8; margin: 2rem 0; max-width: 610px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.button { align-items: center; background: var(--saffron); border: 1px solid var(--saffron); color: var(--white); display: inline-flex; font-size: .72rem; font-weight: 900; letter-spacing: .08em; min-height: 48px; padding: 0 1.25rem; text-transform: uppercase; }
.button.secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.button:hover, .button:focus-visible { background: var(--ocean); border-color: var(--ocean); color: var(--white); outline: none; }
.hero-image { margin: 0; min-height: 690px; overflow: hidden; position: relative; }
.hero-image img { height: 100%; object-fit: cover; width: 100%; }
.hero-image figcaption { background: rgba(8, 47, 52, .88); bottom: 0; color: rgba(255, 255, 255, .78); font-size: .72rem; left: 0; padding: 1rem 1.2rem; position: absolute; right: 0; }
.hero-image figcaption strong { color: var(--white); display: block; font-family: var(--serif); font-size: 1rem; font-weight: 400; margin-bottom: .25rem; }

.section { padding: clamp(5rem, 9vw, 8rem) 6vw; }
.section-heading { align-items: end; display: grid; gap: 4rem; grid-template-columns: 1.2fr .8fr; margin: 0 auto 3.5rem; max-width: 1380px; }
.section-heading h2, .archive-heading h2, .visit-heading h2 { font-family: var(--serif); font-size: clamp(2.5rem, 4vw, 4.8rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.02; margin: 0; }
.section-heading > p { color: var(--muted); line-height: 1.8; margin: 0; max-width: 580px; }

.collection-grid { border-left: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto; max-width: 1380px; }
.collection-card { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 500px; overflow: hidden; transition: background 180ms ease, color 180ms ease; }
.collection-image { background: #d8ddd8; height: 190px; overflow: hidden; position: relative; }
.collection-image::after { background: linear-gradient(180deg, transparent, rgba(8, 37, 40, .32)); content: ""; inset: 0; position: absolute; }
.collection-image img { height: 100%; object-fit: cover; transition: transform 500ms ease; width: 100%; }
.collection-number { background: rgba(8, 37, 40, .84); color: var(--white); font-family: var(--serif); font-size: .76rem; letter-spacing: .1em; padding: .45rem .55rem; position: absolute; right: 1rem; top: 1rem; z-index: 1; }
.collection-content { display: flex; flex: 1; flex-direction: column; padding: 1.7rem 2rem 2rem; }
.collection-card h3 { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; margin: 0 0 .2rem; }
.collection-card h3 small { color: #7d7060; display: block; font-family: var(--sans); font-size: .78rem; font-weight: 500; margin-top: .45rem; }
.collection-card p { color: var(--muted); font-size: .91rem; line-height: 1.7; margin: 1.25rem 0 1.8rem; }
.card-link { color: var(--saffron); font-size: .7rem; font-weight: 900; letter-spacing: .09em; margin-top: auto; text-transform: uppercase; }
.collection-card:hover, .collection-card:focus-visible { background: var(--ocean); color: var(--white); outline: none; }
.collection-card:hover p, .collection-card:focus-visible p, .collection-card:hover h3 small, .collection-card:focus-visible h3 small { color: rgba(255, 255, 255, .76); }
.collection-card:hover .collection-image img, .collection-card:focus-visible .collection-image img { transform: scale(1.035); }

.archive-section { background: var(--deep-ocean); color: var(--white); }
.archive-wrap { margin: 0 auto; max-width: 1380px; }
.archive-heading { align-items: end; display: grid; gap: 3rem; grid-template-columns: 1fr 1fr; margin-bottom: 2.5rem; }
.archive-heading .kicker { grid-column: 1 / -1; margin-bottom: -1rem; }
.archive-heading > p:last-child { color: #b9ccc7; line-height: 1.75; margin: 0; }
.archive-search { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 2rem; }
.archive-search input { border: 0; border-radius: 0; font-family: var(--serif); font-size: 1.05rem; min-height: 62px; padding: 0 1.2rem; width: 100%; }
.archive-search button { background: var(--saffron); border: 0; color: var(--white); cursor: pointer; font-weight: 900; padding: 0 1.5rem; }
.archive-search button:hover, .archive-search button:focus-visible { background: #ee914b; }
.resource-grid { border-left: 1px solid rgba(255, 255, 255, .16); border-top: 1px solid rgba(255, 255, 255, .16); display: grid; grid-template-columns: repeat(3, 1fr); }
.resource-card { border-bottom: 1px solid rgba(255, 255, 255, .16); border-right: 1px solid rgba(255, 255, 255, .16); display: flex; flex-direction: column; min-height: 250px; padding: 1.6rem; }
.resource-card:hover, .resource-card:focus-within { background: rgba(255, 255, 255, .07); }
.resource-meta { color: #f0aa65; font-size: .66rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.resource-card h3 { font-family: var(--serif); font-size: 1.28rem; font-weight: 400; line-height: 1.28; margin: 1.7rem 0 .7rem; }
.resource-card p { color: #aec3bd; font-size: .84rem; line-height: 1.65; margin: 0 0 1.4rem; }
.resource-card a { color: var(--white); font-size: .7rem; font-weight: 900; margin-top: auto; text-transform: uppercase; }

.journey-list { margin: 0 auto; max-width: 1380px; }
.journey { border-top: 1px solid var(--line); display: grid; gap: clamp(2rem, 6vw, 7rem); grid-template-columns: .9fr 1.1fr; padding: 3rem 0; }
.journey:nth-child(even) .journey-image { order: 2; }
.journey-image { height: 390px; overflow: hidden; }
.journey-image img { height: 100%; object-fit: cover; width: 100%; }
.journey-copy { align-self: center; }
.journey-copy h3 { font-family: var(--serif); font-size: clamp(2rem, 3vw, 3.4rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.08; margin: 0; }
.journey-copy > p:not(.kicker) { color: var(--muted); line-height: 1.8; }
.journey-copy ul { border-top: 1px solid var(--line); list-style: none; margin: 2rem 0 0; padding: 0; }
.journey-copy li { border-bottom: 1px solid var(--line); }
.journey-copy li a { display: flex; font-size: .74rem; font-weight: 800; justify-content: space-between; padding: .9rem 0; }
.journey-copy li a:hover { color: var(--saffron); }

.visit-section { background: var(--cream); display: grid; gap: 2rem; grid-template-columns: 1.1fr repeat(3, .7fr); }
.visit-heading { padding-right: 2rem; }
.visit-heading > p:last-child { color: var(--muted); line-height: 1.75; }
.visit-card { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 260px; padding-left: 1.5rem; }
.visit-card strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; }
.visit-card p { color: var(--muted); font-size: .86rem; line-height: 1.7; }
.visit-card a { color: var(--saffron); font-size: .7rem; font-weight: 900; margin-top: auto; text-transform: uppercase; }

.content-shell { margin: 0 auto; max-width: 1050px; padding: clamp(4rem, 8vw, 7rem) 6vw; }
.page-title { font-family: var(--serif); font-size: clamp(2.8rem, 5vw, 5.5rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.02; margin: 0 0 2.5rem; }
.entry-card { border-top: 1px solid var(--line); padding: 2rem 0; }
.entry-card h2 { font-family: var(--serif); font-size: 2rem; font-weight: 400; margin: 0 0 .7rem; }
.entry-card .entry-meta { color: var(--saffron); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.entry-content { font-family: var(--serif); font-size: 1.08rem; line-height: 1.85; }
.entry-content a { color: var(--ocean); text-decoration: underline; }
.entry-content img { height: auto; margin: 1.5rem auto; }
.legacy-shell { max-width: 1180px; }
.legacy-entry { background: var(--white); border-top: 4px solid var(--saffron); padding: clamp(1.5rem, 4vw, 4rem); }
.legacy-source { border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; margin: -1rem 0 2.5rem; padding-bottom: 1rem; }
.legacy-source span { font-weight: 800; }
.legacy-page-content { overflow-wrap: anywhere; }
.legacy-page-content > :first-child { margin-top: 0; }
.legacy-page-content h1, .legacy-page-content h2, .legacy-page-content h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
.legacy-page-content table { border-collapse: collapse; display: block; margin: 1.25rem auto; max-width: 100%; overflow-x: auto; width: max-content; }
.legacy-page-content td, .legacy-page-content th { padding: .4rem .6rem; vertical-align: top; }
.legacy-page-content center { text-align: center; }
.legacy-page-content font { font-family: inherit; }
.legacy-page-content iframe { aspect-ratio: 16 / 9; height: auto; max-width: 100%; width: 100%; }
.legacy-page-content .adsbygoogle { clear: both; display: block; margin: 1.5rem auto; max-width: 100%; overflow: hidden; }
.legacy-page-content .tcai-preserved-ad { min-height: 90px; }
.pagination { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.pagination .nav-links { display: flex; gap: .7rem; }
.pagination a, .pagination span { border: 1px solid var(--line); padding: .6rem .8rem; }

.site-footer { align-items: start; background: #061f22; color: #d5e1de; display: grid; gap: 2rem; grid-template-columns: 1fr auto; padding: 3rem 6vw; }
.site-footer strong { color: var(--white); display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 400; }
.site-footer p { color: #91aaa5; font-size: .78rem; line-height: 1.6; max-width: 650px; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { font-size: .68rem; font-weight: 800; text-transform: uppercase; }

@media (max-width: 1020px) {
  .site-header { grid-template-areas: "branding tools" "navigation navigation"; grid-template-columns: minmax(0, 1fr) auto; padding-bottom: .75rem; }
  .menu-toggle { display: block; }
  .primary-nav { background: var(--paper); border-bottom: 1px solid var(--line); display: none; justify-self: stretch; padding: .75rem 0 .25rem; }
  .primary-nav.open { display: block; }
  .primary-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .primary-nav a { display: block; padding: .65rem 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-image { min-height: 520px; }
  .collection-grid, .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .visit-section { grid-template-columns: 1fr 1fr; }
  .visit-heading { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .site-header { gap: .6rem; min-height: 72px; padding: .7rem 1rem; }
  .site-branding strong { font-size: 1.08rem; }
  .site-branding small { font-size: .52rem; letter-spacing: .05em; line-height: 1.25; }
  .language-area > span { display: none; }
  .header-tools { gap: .4rem; }
  .language-area .gtranslate_wrapper, .language-area .gt_switcher, .language-area .gt_selected, .language-area .gt_selected > a { max-width: 118px; width: 118px !important; }
  body.home > .site-header + .google-auto-placed { margin-bottom: .75rem !important; margin-top: .75rem !important; width: calc(100% - 1.5rem) !important; }
  .hero-copy { padding: 4rem 1.25rem; }
  .hero h1 { font-size: clamp(3.4rem, 17vw, 5.5rem); }
  .hero-image { min-height: 420px; }
  .section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .section-heading, .archive-heading, .collection-grid, .resource-grid, .journey, .visit-section, .site-footer { grid-template-columns: 1fr; }
  .section-heading { gap: 1.2rem; }
  .collection-card { min-height: 470px; }
  .collection-image { height: 200px; }
  .archive-heading .kicker { margin-bottom: -2rem; }
  .archive-search { grid-template-columns: 1fr; }
  .archive-search button { min-height: 52px; }
  .journey:nth-child(even) .journey-image { order: 0; }
  .journey-image { height: 310px; }
  .visit-heading { grid-column: auto; }
  .visit-card { border-left: 0; border-top: 1px solid var(--line); padding: 1.5rem 0 0; }
  .site-footer { align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
