/* -------------------------------------------------------------------------
   Opera Mondo — styles.css
   A single-purpose, minimal landing page. Restrained typography,
   a full-screen atmospheric image, and one job: search.
   ---------------------------------------------------------------------- */

:root {
  /* Palette */
  --color-ink: #0d0d12;          /* deepest overlay tone, near-black */
  --color-ink-soft: #1a1a22;     /* overlay midtone */
  --color-cream: #f5f1e8;        /* primary text on dark background */
  --color-cream-dim: #cfc9bd;    /* secondary text / hairline */
  --color-gold: #c9a227;         /* single accent, used sparingly */
  --color-focus: #e8c766;        /* focus ring, brighter for visibility */
  --color-glass: rgba(10, 10, 15, 0.38); /* subtle translucent search panel */
  --color-glass-border: rgba(245, 241, 232, 0.16);

  /* Type */
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Iowan Old Style", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --content-max-width: 640px;
  --space-edge: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------------------------------------------------------------------- */
/* Reset & base                                                            */
/* ---------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

/* Visible, generous keyboard focus everywhere */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------- */
/* Background layers                                                       */
/* ---------------------------------------------------------------------- */

.hero-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("assets/opera-mondo-page.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  /* The hero image is a pale, light-toned wash, so the overlay needs to run
     darker than it would over a photographic background — this keeps the
     cream headline at a safe WCAG contrast ratio while still letting the
     image's texture and color show through. */
  background:
    linear-gradient(
      180deg,
      rgba(13, 13, 18, 0.55) 0%,
      rgba(13, 13, 18, 0.45) 45%,
      rgba(13, 13, 18, 0.58) 100%
    );
}

/* ---------------------------------------------------------------------- */
/* Content                                                                  */
/* ---------------------------------------------------------------------- */

.content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vh, 2.75rem);
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) var(--space-edge) clamp(4rem, 10vh, 6rem);
  text-align: center;
}

.title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.brand {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-gold);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-wrap: balance;
  color: var(--color-cream);
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------------------------- */
/* Search                                                                   */
/* ---------------------------------------------------------------------- */

.search-wrapper {
  width: 100%;
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.noscript-message {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-cream);
}

.noscript-message a {
  color: var(--color-gold);
  text-decoration-color: var(--color-gold);
}

/* --- Harmonize Google Programmable Search Engine with the page --------- */
/* Selectors target Google's documented top-level classes only, so the
   underlying search behaviour, accessibility, and results are untouched. */

.gsc-control-cse {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  font-family: var(--font-body) !important;
}

.gsc-input-box {
  border-radius: 6px !important;
  background: rgba(245, 241, 232, 0.96) !important;
}

.gsc-search-button .gsc-search-button-v2 {
  border-radius: 6px !important;
  background-color: var(--color-gold) !important;
  border-color: var(--color-gold) !important;
  padding: 9px 14px !important;
}

.gsc-search-button .gsc-search-button-v2:hover,
.gsc-search-button .gsc-search-button-v2:focus {
  background-color: var(--color-focus) !important;
  border-color: var(--color-focus) !important;
}

.gsc-results-wrapper-overlay {
  background: var(--color-ink) !important;
}

.gsc-results-wrapper-visible {
  border-color: var(--color-glass-border) !important;
}

/* Prevent search results from overflowing narrow mobile viewports */
.gsc-control-cse,
.gsc-control-cse * {
  max-width: 100%;
}

.gsc-webResult.gsc-result,
.gsc-results .gsc-imageResult {
  overflow-wrap: break-word;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--color-glass-border);
  border-radius: 999px;
  color: var(--color-cream);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cta-link:hover,
.cta-link:focus-visible {
  background-color: var(--color-gold);
  color: var(--color-ink);
  border-color: var(--color-gold);
}

/* ---------------------------------------------------------------------- */
/* News page                                                                */
/* ---------------------------------------------------------------------- */

.news-page {
  background: var(--color-ink);
  min-height: 100vh;
  min-height: 100svh;
  color: var(--color-cream);
}

.news-hero-background {
  background-image: url("assets/opera-mondo-news.jpg");
}

.news-shell {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--space-edge) 5rem;
}

.news-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

.brand-link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-gold);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.brand-link:hover,
.brand-link:focus-visible {
  text-decoration: underline;
}

.news-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  color: var(--color-cream);
}

.news-subtitle {
  font-family: var(--font-body);
  color: var(--color-cream-dim);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.news-status {
  text-align: center;
  color: var(--color-cream-dim);
  font-size: 0.95rem;
  padding: 3rem 0;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-glass-border);
  background: var(--color-glass);
  transition: border-color 0.15s ease;
}

.news-card:hover,
.news-card:focus-visible {
  border-color: var(--color-gold);
}

.news-card img {
  width: 100%;
  display: block;
  aspect-ratio: 800 / 450;
  object-fit: cover;
  background: var(--color-ink);
}

.news-card-body {
  padding: 1.1rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.news-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--color-cream);
}

.news-card-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-cream-dim);
}

.news-card-meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
}

@media (prefers-reduced-motion: reduce) {
  .cta-link,
  .news-card {
    transition: none;
  }
}

.email-link {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-cream-dim);
  background: rgba(13, 13, 18, 0.3);
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.email-link:hover,
.email-link:focus-visible {
  color: var(--color-ink);
  background-color: var(--color-gold);
  border-color: var(--color-gold);
}

@media (prefers-reduced-motion: reduce) {
  .email-link {
    transition: none;
  }
}

/* ---------------------------------------------------------------------- */
/* Small phones & narrow viewports                                         */
/* ---------------------------------------------------------------------- */

@media (max-width: 360px) {
  .search-wrapper {
    padding: 1rem 0.75rem;
  }
}

/* Landscape mobile: reduce vertical breathing room so content still fits */
@media (max-height: 480px) and (orientation: landscape) {
  .content {
    padding-top: 2rem;
    padding-bottom: 2rem;
    gap: 1rem;
  }
}

/* Respect reduced-motion preference globally */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
